[libcxx] r305661 - path: Use string_view_t consistently
Duncan P. N. Exon Smith via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 18 21:27:41 PDT 2017
Author: dexonsmith
Date: Sun Jun 18 23:27:41 2017
New Revision: 305661
URL: http://llvm.org/viewvc/llvm-project?rev=305661&view=rev
Log:
path: Use string_view_t consistently
Most of filesystem/path.cpp uses string_view_t. This fixes the two spots
that use string_view directly.
https://reviews.llvm.org/D34332
Modified:
libcxx/trunk/src/experimental/filesystem/path.cpp
Modified: libcxx/trunk/src/experimental/filesystem/path.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/path.cpp?rev=305661&r1=305660&r2=305661&view=diff
==============================================================================
--- libcxx/trunk/src/experimental/filesystem/path.cpp (original)
+++ libcxx/trunk/src/experimental/filesystem/path.cpp Sun Jun 18 23:27:41 2017
@@ -261,7 +261,8 @@ private:
string_view_pair separate_filename(string_view_t const & s) {
if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""};
auto pos = s.find_last_of('.');
- if (pos == string_view_t::npos) return string_view_pair{s, string_view{}};
+ if (pos == string_view_t::npos)
+ return string_view_pair{s, string_view_t{}};
return string_view_pair{s.substr(0, pos), s.substr(pos)};
}
@@ -396,7 +397,7 @@ int path::__compare(string_view_t __s) c
size_t hash_value(const path& __p) noexcept {
auto PP = PathParser::CreateBegin(__p.native());
size_t hash_value = 0;
- std::hash<string_view> hasher;
+ std::hash<string_view_t> hasher;
while (PP) {
hash_value = __hash_combine(hash_value, hasher(*PP));
++PP;
More information about the cfe-commits
mailing list