Use std::string_view keys for UpperMap

This avoids constructing temporary `std::string` objects on lookup
This commit is contained in:
Rangi
2026-05-27 21:11:39 -04:00
committed by Rangi
parent 007672f080
commit 673c62414f
3 changed files with 24 additions and 12 deletions
+4
View File
@@ -101,6 +101,10 @@ static inline int clz(unsigned int x) {
#define RANGE(s) std::begin(s), std::end(s)
#define RRANGE(s) std::rbegin(s), std::rend(s)
// Macros to print-format a `std::string_view` (like <inttype.h> macros)
#define PRI_SV ".*s"
#define PRI_SV_ARG(sv) static_cast<int>((sv).length()), (sv).data()
// MSVC does not inline `strlen()` or `.length()` of a constant string
template<int SizeOfString>
requires(SizeOfString > 0)