From af4aa1f9595974478ff7ce50f032385bb2e93238 Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Mon, 2 Mar 2020 15:47:42 -0500 Subject: [PATCH] DRY per comments in #631 Co-authored-by: Sawood Alam --- ipwb/replay.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ipwb/replay.py b/ipwb/replay.py index 74337f9c..ae0ffe86 100755 --- a/ipwb/replay.py +++ b/ipwb/replay.py @@ -188,7 +188,6 @@ def bin_search(iter, key, datetime=None): ln = iter.readline() surtk, datetimeK, rest = ln.split(maxsplit=2) - datetimeK = datetimeK.decode() matchDegree = getMatchDegree(surt, datetime, surtk, datetimeK) if matchDegree == MementoMatch.EXACTMATCH: @@ -212,7 +211,6 @@ def bin_search(iter, key, datetime=None): continue surtk, datetimeK, rest = line.split(maxsplit=2) - datetimeK = datetimeK.decode() surtk = surtk.rstrip(b"/") key = key.rstrip(b"/") @@ -226,7 +224,6 @@ def bin_search(iter, key, datetime=None): while nextLine: surtk, datetimeK, rest = nextLine.split(maxsplit=2) surtk = surtk.rstrip(b"/") - datetimeK = datetimeK.decode() matchDegree = getMatchDegree(key, datetime, surtk, datetimeK) if matchDegree == MementoMatch.RIGHTKEYWRONGDATE: @@ -259,6 +256,7 @@ def bin_search(iter, key, datetime=None): def getMatchDegree(surt, datetime, surtK, datetimeK): if surt == surtK: + datetimeK = datetimeK.decode() if datetime is None or datetime is not None and datetime != datetimeK: return MementoMatch.RIGHTKEYWRONGDATE if datetime == datetimeK: