diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-12 21:12:36 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-12 21:32:30 +0000 |
commit | f6f01416b71f239c0d9594f5c6201dfd208fe8c4 (patch) | |
tree | f8553504b0b9630ba8fef19ccfd9668b1f70c5e1 /src/libstore/store-api.cc | |
parent | 2853ba4ab26c254d564aee9e75fe8f9f664b94fc (diff) |
Use `std::string_view` in a few more places
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 0645fca84..f6901bf42 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -779,7 +779,7 @@ bool ValidPathInfo::isContentAddressed(const Store & store) const }; if (hasPrefix(ca, "text:")) { - Hash hash(std::string(ca, 5)); + Hash hash(ca.substr(5)); if (store.makeTextPath(path.name(), hash, references) == path) return true; else @@ -788,7 +788,7 @@ bool ValidPathInfo::isContentAddressed(const Store & store) const else if (hasPrefix(ca, "fixed:")) { FileIngestionMethod recursive { ca.compare(6, 2, "r:") == 0 }; - Hash hash(std::string(ca, recursive == FileIngestionMethod::Recursive ? 8 : 6)); + Hash hash(ca.substr(recursive == FileIngestionMethod::Recursive ? 8 : 6)); auto refs = cloneStorePathSet(references); bool hasSelfReference = false; if (refs.count(path)) { |