diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:08:40 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:30:26 +0100 |
commit | 4956c3dc10bc856739c6371f048031543376090e (patch) | |
tree | 4631e439f9d6cbd3b8921424a2e5d0b9dad26859 /src | |
parent | dd9dcfa363f6219d30b5f229fa8097c03395698e (diff) |
plop:consistency: Correct off-by-one error
Diffstat (limited to 'src')
-rw-r--r-- | src/plop.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plop.erl b/src/plop.erl index 821fe99..114695d 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -135,11 +135,11 @@ spt(Data) -> signature = sign:sign(Data)}. consistency(TreeSizeFirst, TreeSizeSecond) -> - LastAllowedEntry = db:size() - 1, + TreeSize = db:size(), if - TreeSizeFirst > LastAllowedEntry -> + TreeSizeFirst >= TreeSizeSecond -> []; - TreeSizeSecond > LastAllowedEntry -> + TreeSizeSecond > TreeSize -> []; true -> ht:consistency(TreeSizeFirst - 1, TreeSizeSecond - 1) |