diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-19 12:08:40 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2015-02-27 02:29:17 +0100 |
commit | 0e19b2c56ee6b7819b0993a3a2e74e8838dc1014 (patch) | |
tree | 380e8c090b04267a3a6c6c62ac05fd24a730b071 /src | |
parent | af85769f423b4bd1042ad5f89710090cd8ae3a7e (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) |