diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2017-06-19 04:27:41 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2017-06-19 04:27:41 +0000 |
commit | 7db4f7b42648a33050ff1a8c85098080ebe55d34 (patch) | |
tree | 671301af170572b68abcdc0915ac6610733beac2 /src | |
parent | 2b93569a364e4d09df12887d950635de40f502c4 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r-- | src/experimental/filesystem/path.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/experimental/filesystem/path.cpp b/src/experimental/filesystem/path.cpp index f49d4cd2d..dd4026cfe 100644 --- a/src/experimental/filesystem/path.cpp +++ b/src/experimental/filesystem/path.cpp @@ -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) const { 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; |