From b52ea4cff68445096ae5d8e1a74ca59582a260b7 Mon Sep 17 00:00:00 2001 From: Robert Smallshire Date: Thu, 7 May 2015 13:49:38 +0200 Subject: [PATCH] Simplifies comparison statements in encoding.py --- segpy/encoding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/segpy/encoding.py b/segpy/encoding.py index 149230e..c02d2ca 100644 --- a/segpy/encoding.py +++ b/segpy/encoding.py @@ -64,10 +64,10 @@ def guess_encoding(bs, threshold=0.5): if null_freq == 1.0: return ASCII # Doesn't matter - if ebcdic_freq < threshold and ascii_freq >= threshold: + if ebcdic_freq < threshold <= ascii_freq: return ASCII - if ebcdic_freq >= threshold and ascii_freq < threshold: + if ebcdic_freq >= threshold > ascii_freq: return EBCDIC if ebcdic_freq < threshold and ascii_freq < threshold: