diff --git a/src/gdb-index.cc b/src/gdb-index.cc index a87b769180..6061163fc3 100644 --- a/src/gdb-index.cc +++ b/src/gdb-index.cc @@ -127,16 +127,10 @@ struct SectionHeader { }; struct NameType { - bool operator==(const NameType &) const = default; - - bool operator<(const NameType &other) const { - return std::tuple(hash, type, name) < - std::tuple(other.hash, other.type, other.name); - } - - std::string_view name; + auto operator<=>(const NameType &) const = default; u64 hash; u8 type; + std::string_view name; }; struct MapValue { @@ -539,7 +533,7 @@ static i64 read_pubnames_cu(Context &ctx, const PubnamesHdr &hdr, u8 type = *p++; std::string_view name = (char *)p; p += name.size() + 1; - cu->nametypes.push_back({name, hash_string(name), type}); + cu->nametypes.push_back({hash_string(name), type, name}); } return size;