aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaci Koblizek <vaci.koblizek@auguration.com>2023-03-28 17:20:33 +0100
committerVaci Koblizek <vaci.koblizek@auguration.com>2023-03-28 17:20:33 +0100
commit957f83207433fec3d9a9b464c6dad0488f3934c8 (patch)
tree5242272deffbfc5669233dd6669331e08c414c08
parent56dc6ed8410510033b835d48b3bd22766e8349a0 (diff)
Avoid a string copy during Hash::to_string
-rw-r--r--src/libutil/hash.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index d2fd0c15a..5a7be47b2 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -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;