diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-02 23:16:57 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-02 23:18:22 +0000 |
commit | 13796be78dfa9d3a189ea6b482659c56b1301634 (patch) | |
tree | a3b333a8b23899083c45b65ba9a89ba3b5881246 /src/libutil/hash.cc | |
parent | a7cd7425d9341cf8a2c3af80b84cc55e874515c6 (diff) |
Have `splitPrefix` and `splitPrefixTo` parser helpers
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r-- | src/libutil/hash.cc | 6 |
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; } |