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
This commit is contained in:
Duncan P. N. Exon Smith
2017-06-19 04:27:41 +00:00
parent 2b93569a36
commit 7db4f7b426

View File

@@ -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;