Added a scan with hash function and labeled the arguments
This commit is contained in:
@@ -175,8 +175,22 @@ public:
|
|||||||
return finishedQuery;
|
return finishedQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void scan(std::function<bool(const std::size_t firstKeyHash,
|
||||||
scan(std::function<bool(const AKey &, const BKey &, Value &)> scanFunction) {
|
const std::size_t secondKeyHash, Value &value)>
|
||||||
|
scanFunction) {
|
||||||
|
for (DualkeyHash *hash : hashList) {
|
||||||
|
if (hash == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (scanFunction(hash->firstKeyHash, hash->secondKeyHash, hash->value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void scan(std::function<bool(const AKey &firstKey, const BKey &secondKey,
|
||||||
|
Value &value)>
|
||||||
|
scanFunction) {
|
||||||
for (DualkeyHash *hash : hashList) {
|
for (DualkeyHash *hash : hashList) {
|
||||||
if (hash == nullptr) {
|
if (hash == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user