dexonsmith created this revision.

Most of filesystem/path.cpp uses `string_view_t`.  This fixes the two spots 
that use `string_view` directly.


https://reviews.llvm.org/D34332

Files:
  libcxx/src/experimental/filesystem/path.cpp


Index: libcxx/src/experimental/filesystem/path.cpp
===================================================================
--- libcxx/src/experimental/filesystem/path.cpp
+++ libcxx/src/experimental/filesystem/path.cpp
@@ -261,7 +261,8 @@
 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 @@
 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;


Index: libcxx/src/experimental/filesystem/path.cpp
===================================================================
--- libcxx/src/experimental/filesystem/path.cpp
+++ libcxx/src/experimental/filesystem/path.cpp
@@ -261,7 +261,8 @@
 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 @@
 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;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D34332: pa... Duncan P. N. Exon Smith via Phabricator via cfe-commits

Reply via email to