Avoid a string copy during Hash::to_string

This commit is contained in:
Vaci Koblizek 2023-03-28 17:20:33 +01:00
parent 56dc6ed841
commit 957f832074

View file

@ -130,7 +130,7 @@ std::string Hash::to_string(Base base, bool includeType) const
break;
case Base64:
case SRI:
s += base64Encode(std::string((const char *) hash, hashSize));
s += base64Encode(std::string_view((const char *) hash, hashSize));
break;
}
return s;