src: use C++20 `consteval` for `FastStringKey` · nodejs/node@86babf9

Original file line numberDiff line numberDiff line change

@@ -618,7 +618,14 @@ constexpr bool FastStringKey::operator==(const FastStringKey& other) const {

618618

return name_ == other.name_;

619619

}

620620
621-

constexpr FastStringKey::FastStringKey(std::string_view name)

621+

consteval FastStringKey::FastStringKey(std::string_view name)

622+

: FastStringKey(name, 0) {}

623+
624+

constexpr FastStringKey FastStringKey::AllowDynamic(std::string_view name) {

625+

return FastStringKey(name, 0);

626+

}

627+
628+

constexpr FastStringKey::FastStringKey(std::string_view name, int dummy)

622629

: name_(name), cached_hash_(HashImpl(name)) {}

623630
624631

constexpr std::string_view FastStringKey::as_string_view() const {