[libcxx-commits] [libcxx] 5888e5a - [libc++][NFC] Remove stray whitespace in string_view
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 28 05:04:47 PST 2022
Author: Louis Dionne
Date: 2022-11-28T08:04:15-05:00
New Revision: 5888e5aebce6294c60ba1f8f1ab8df1bf5f721a4
URL: https://github.com/llvm/llvm-project/commit/5888e5aebce6294c60ba1f8f1ab8df1bf5f721a4
DIFF: https://github.com/llvm/llvm-project/commit/5888e5aebce6294c60ba1f8f1ab8df1bf5f721a4.diff
LOG: [libc++][NFC] Remove stray whitespace in string_view
Added:
Modified:
libcxx/include/string_view
Removed:
################################################################################
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 2ee6043eb156..3ec086e69b56 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -191,11 +191,11 @@ namespace std {
template <> struct hash<u32string_view>;
template <> struct hash<wstring_view>;
- constexpr basic_string_view<char> operator "" sv( const char *str, size_t len ) noexcept;
- constexpr basic_string_view<wchar_t> operator "" sv( const wchar_t *str, size_t len ) noexcept;
- constexpr basic_string_view<char8_t> operator "" sv( const char8_t *str, size_t len ) noexcept; // C++20
- constexpr basic_string_view<char16_t> operator "" sv( const char16_t *str, size_t len ) noexcept;
- constexpr basic_string_view<char32_t> operator "" sv( const char32_t *str, size_t len ) noexcept;
+ constexpr basic_string_view<char> operator "" sv(const char *str, size_t len) noexcept;
+ constexpr basic_string_view<wchar_t> operator "" sv(const wchar_t *str, size_t len) noexcept;
+ constexpr basic_string_view<char8_t> operator "" sv(const char8_t *str, size_t len) noexcept; // C++20
+ constexpr basic_string_view<char16_t> operator "" sv(const char16_t *str, size_t len) noexcept;
+ constexpr basic_string_view<char32_t> operator "" sv(const char32_t *str, size_t len) noexcept;
} // namespace std
@@ -281,7 +281,7 @@ public:
// [string.view.cons], construct/copy
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
- basic_string_view() _NOEXCEPT : __data_ (nullptr), __size_(0) {}
+ basic_string_view() _NOEXCEPT : __data_(nullptr), __size_(0) {}
_LIBCPP_INLINE_VISIBILITY
basic_string_view(const basic_string_view&) _NOEXCEPT = default;
@@ -450,10 +450,10 @@ public:
_LIBCPP_CONSTEXPR_SINCE_CXX14 int compare(basic_string_view __sv) const _NOEXCEPT
{
- size_type __rlen = _VSTD::min( size(), __sv.size());
+ size_type __rlen = _VSTD::min(size(), __sv.size());
int __retval = _Traits::compare(data(), __sv.data(), __rlen);
- if ( __retval == 0 ) // first __rlen chars matched
- __retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 );
+ if (__retval == 0) // first __rlen chars matched
+ __retval = size() == __sv.size() ? 0 : (size() < __sv.size() ? -1 : 1);
return __retval;
}
@@ -748,7 +748,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator==(basic_string_view<_CharT, _Traits> __lhs,
basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size()) return false;
+ if (__lhs.size() != __rhs.size()) return false;
return __lhs.compare(__rhs) == 0;
}
@@ -759,7 +759,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator==(basic_string_view<_CharT, _Traits> __lhs,
__type_identity_t<basic_string_view<_CharT, _Traits> > __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size()) return false;
+ if (__lhs.size() != __rhs.size()) return false;
return __lhs.compare(__rhs) == 0;
}
@@ -770,7 +770,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator==(__type_identity_t<basic_string_view<_CharT, _Traits> > __lhs,
basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size()) return false;
+ if (__lhs.size() != __rhs.size()) return false;
return __lhs.compare(__rhs) == 0;
}
#endif // _LIBCPP_STD_VER > 17
@@ -814,7 +814,7 @@ template<class _CharT, class _Traits>
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size())
+ if (__lhs.size() != __rhs.size())
return true;
return __lhs.compare(__rhs) != 0;
}
@@ -824,7 +824,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator!=(basic_string_view<_CharT, _Traits> __lhs,
__type_identity_t<basic_string_view<_CharT, _Traits> > __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size())
+ if (__lhs.size() != __rhs.size())
return true;
return __lhs.compare(__rhs) != 0;
}
@@ -834,7 +834,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
bool operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> > __lhs,
basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
{
- if ( __lhs.size() != __rhs.size())
+ if (__lhs.size() != __rhs.size())
return true;
return __lhs.compare(__rhs) != 0;
}
More information about the libcxx-commits
mailing list