Renamed resultpair to queryresult for clarity

This commit is contained in:
2026-01-28 12:58:30 +02:00
parent ea83805f4b
commit c458062f72

View File

@@ -26,7 +26,7 @@ template <Hashable AKey, Hashable BKey, typename Value,
uint64_t baseReservation = 2048, double maxTombstoneRatio = 0.25> uint64_t baseReservation = 2048, double maxTombstoneRatio = 0.25>
class DualkeyMap { class DualkeyMap {
public: public:
using ResultPair = using QueryResult =
std::pair<std::variant<std::monostate, std::reference_wrapper<const AKey>, std::pair<std::variant<std::monostate, std::reference_wrapper<const AKey>,
std::reference_wrapper<const BKey>>, std::reference_wrapper<const BKey>>,
Value &>; Value &>;
@@ -121,7 +121,7 @@ public:
} }
[[nodiscard("Discarding an expensive operation's result!")]] [[nodiscard("Discarding an expensive operation's result!")]]
std::vector<ResultPair> query(std::optional<AKey> firstKey, std::vector<QueryResult> query(std::optional<AKey> firstKey,
std::optional<BKey> secondKey) { std::optional<BKey> secondKey) {
bool isFirstKeyGiven = firstKey.has_value(); bool isFirstKeyGiven = firstKey.has_value();
bool isSecondKeyGiven = secondKey.has_value(); bool isSecondKeyGiven = secondKey.has_value();
@@ -137,7 +137,7 @@ public:
std::size_t secondKeyHash = std::size_t secondKeyHash =
isSecondKeyGiven ? std::hash<BKey>{}(secondKey.value()) : 0; isSecondKeyGiven ? std::hash<BKey>{}(secondKey.value()) : 0;
std::vector<ResultPair> finishedQuery{}; std::vector<QueryResult> finishedQuery{};
uint8_t stateOfIndexing = isFirstKeyGiven + (isSecondKeyGiven << 1); uint8_t stateOfIndexing = isFirstKeyGiven + (isSecondKeyGiven << 1);
// Putting hash checks first to benefit from short circuits // Putting hash checks first to benefit from short circuits