aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-02 23:16:57 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-02 23:18:22 +0000
commit13796be78dfa9d3a189ea6b482659c56b1301634 (patch)
treea3b333a8b23899083c45b65ba9a89ba3b5881246 /src/libutil/hash.cc
parenta7cd7425d9341cf8a2c3af80b84cc55e874515c6 (diff)
Have `splitPrefix` and `splitPrefixTo` parser helpers
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 76fa67086..35054462c 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -136,7 +136,7 @@ Hash Hash::parseSRI(std::string_view original) {
auto rest = original;
// Parse the has type before the separater, if there was one.
- auto hashRaw = splitPrefix(rest, '-');
+ auto hashRaw = splitPrefixTo(rest, '-');
if (!hashRaw)
throw BadHash("hash '%s' is not SRI", original);
HashType parsedType = parseHashType(*hashRaw);
@@ -151,10 +151,10 @@ static std::pair<std::optional<HashType>, bool> getParsedTypeAndSRI(std::string_
// Parse the has type before the separater, if there was one.
std::optional<HashType> optParsedType;
{
- auto hashRaw = splitPrefix(rest, ':');
+ auto hashRaw = splitPrefixTo(rest, ':');
if (!hashRaw) {
- hashRaw = splitPrefix(rest, '-');
+ hashRaw = splitPrefixTo(rest, '-');
if (hashRaw)
isSRI = true;
}