summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ht.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ht.erl b/src/ht.erl
index 87090f0..80a0d29 100644
--- a/src/ht.erl
+++ b/src/ht.erl
@@ -335,7 +335,7 @@ update(Tree) ->
%% @doc Calculate hashes in Tree up to and including node with index
%% equal to Version. Update Tree.evaluated to reflect the new state.
-spec update(tree(), non_neg_integer()) -> tree().
-update(Tree, 0) ->
+update(Tree = #tree{evaluated = E}, 0) when E == -1 ->
%% A version 0 tree needs no updating.
Tree#tree{evaluated = 0};
update(Tree = #tree{evaluated = E}, V) when E >= V ->