Re-introduce missing shortcut
Can't discover missing keys sooner by reporting missing on a zero hash.
This commit is contained in:
parent
52c7a023a1
commit
495f6c3fd9
1 changed files with 9 additions and 0 deletions
|
@ -1368,6 +1368,8 @@ search_hash_table(Handle,
|
|||
UpdTimings = update_fetchtimings(Timings, CycleCount),
|
||||
{UpdTimings, KV}
|
||||
end;
|
||||
0 ->
|
||||
{Timings, missing};
|
||||
_ ->
|
||||
search_hash_table(Handle,
|
||||
{FirstHashPosition,
|
||||
|
@ -1850,6 +1852,13 @@ cyclecount_test() ->
|
|||
lists:foreach(fun({K, V}) ->
|
||||
?assertMatch({K, V}, cdb_get(P2, K)) end,
|
||||
KVL2),
|
||||
% Test many missing keys
|
||||
lists:foreach(fun(X) ->
|
||||
K = "NotKey" ++ integer_to_list(X),
|
||||
?assertMatch(missing, cdb_get(P2, K))
|
||||
end,
|
||||
lists:seq(1, 5000)),
|
||||
|
||||
ok = cdb_close(P2),
|
||||
ok = file:delete("../test/cycle_count.cdb").
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue