From ccf7ce26fe6207d7a648715a45985379f772931f Mon Sep 17 00:00:00 2001 From: Vaci Koblizek Date: Wed, 29 Mar 2023 10:44:22 +0100 Subject: [PATCH] return string_view from printHashType rather than string --- src/libutil/hash.cc | 2 +- src/libutil/hash.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 5a7be47b2..84832c4ad 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -403,7 +403,7 @@ HashType parseHashType(std::string_view s) throw UsageError("unknown hash algorithm '%1%'", s); } -std::string printHashType(HashType ht) +std::string_view printHashType(HashType ht) { switch (ht) { case htMD5: return "md5"; diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 00f70a572..38d09646e 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -133,7 +133,7 @@ HashType parseHashType(std::string_view s); std::optional parseHashTypeOpt(std::string_view s); /* And the reverse. */ -std::string printHashType(HashType ht); +std::string_view printHashType(HashType ht); union Ctx;