From 2458a90fb3eebb82c693d4186a021db04d747198 Mon Sep 17 00:00:00 2001 From: martinsumner Date: Wed, 9 Nov 2016 16:35:13 +0000 Subject: [PATCH] Remove overlapped case clause --- src/leveled_cdb.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/leveled_cdb.erl b/src/leveled_cdb.erl index fd9ec54..f7d3056 100644 --- a/src/leveled_cdb.erl +++ b/src/leveled_cdb.erl @@ -885,12 +885,13 @@ startup_scan_over_file(Handle, Position) -> %% cdb file, and returns at the end the hashtree and the final Key seen in the %% journal -startup_filter(Key, ValueAsBin, Position, {Hashtree, LastKey}, _ExtractFun) -> +startup_filter(Key, ValueAsBin, Position, {Hashtree, _LastKey}, _ExtractFun) -> case crccheck_value(ValueAsBin) of true -> - {loop, {put_hashtree(Key, Position, Hashtree), Key}}; - false -> - {stop, {Hashtree, LastKey}} + % This function is preceeded by a "safe read" of the key and value + % and so the crccheck should always be true, as a failed check + % should not reach this stage + {loop, {put_hashtree(Key, Position, Hashtree), Key}} end.