Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 1fc1121

Browse files
committed
inline_string: refactor compare() to take string_view
instead of basic_inline_string so that there is no implicit copy of inline_string when string_view is passed. Authored by: Igor Chorazewicz
1 parent bf3438a commit 1fc1121

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/libpmemobj++/experimental/inline_string.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class basic_inline_string_base {
6161
const_pointer data() const noexcept;
6262
const_pointer cdata() const noexcept;
6363

64-
int compare(const basic_inline_string_base &rhs) const noexcept;
64+
int compare(basic_string_view<CharT, Traits> rhs) const noexcept;
6565

6666
reference operator[](size_type p);
6767
const_reference operator[](size_type p) const noexcept;
@@ -342,7 +342,7 @@ basic_inline_string_base<CharT, Traits>::cdata() const noexcept
342342
template <typename CharT, typename Traits>
343343
int
344344
basic_inline_string_base<CharT, Traits>::compare(
345-
const basic_inline_string_base &rhs) const noexcept
345+
basic_string_view<CharT, Traits> rhs) const noexcept
346346
{
347347
return basic_string_view<CharT, Traits>(data(), size()).compare(rhs);
348348
}

0 commit comments

Comments
 (0)