summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-03-06 03:46:47 +0100
committerMagnus Ahltorp <map@kth.se>2017-03-06 03:46:47 +0100
commit78266b673e6d628f971bf60beb47db91e9feff2f (patch)
treee99944c91bf7b0666b58dd0cfa1066433e7c5cef
parentac37fedbe4249f5795795d722c8e72a0b8cc2e2f (diff)
Never go back to evaluated=0httpchunking
-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 ->