mirror of
https://github.com/NixOS/nix
synced 2025-06-30 15:48:00 +02:00
Add Hash::dummy to signal default value
We did this in the same spirit of the dummy value that's present in libstore/path.hh
This commit is contained in:
parent
1d71028f4d
commit
1ad6394b33
4 changed files with 7 additions and 3 deletions
|
@ -136,6 +136,8 @@ std::string Hash::to_string(Base base, bool includeType) const
|
|||
return s;
|
||||
}
|
||||
|
||||
Hash Hash::dummy(htSHA256);
|
||||
|
||||
Hash Hash::parseSRI(std::string_view original) {
|
||||
auto rest = original;
|
||||
|
||||
|
|
|
@ -105,6 +105,8 @@ public:
|
|||
assert(type == htSHA1);
|
||||
return std::string(to_string(Base16, false), 0, 7);
|
||||
}
|
||||
|
||||
static Hash dummy;
|
||||
};
|
||||
|
||||
/* Helper that defaults empty hashes to the 0 hash. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue