From fcfd29f6e7a6692cedc90fdc04d7b9b6c7101bbf Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Mon, 8 Dec 2008 23:25:07 +0000 Subject: [PATCH] compress: restoring sort requirement for safety --- compress_fingerprints | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compress_fingerprints b/compress_fingerprints index 993f5d6..655001c 100755 --- a/compress_fingerprints +++ b/compress_fingerprints @@ -41,11 +41,13 @@ sub populate_fingerprint { $fp{sha1} = sha1_base64($stripped); # make sure file is sorted properly - #if ($lastscore and $fp{compact} > $lastscore) { - # print "Input file is sorted improperly or unsorted.\n"; - # die "Sort descending (sort -ru) and rerun this script.\n"; - #} - #$lastscore = $fp{compact}; + # actually, the input can be sorted *either* way and produce identical + # results, but a descending sort produces lower runtime + if ($lastscore and $fp{compact} > $lastscore) { + print "Input file is sorted improperly or unsorted.\n"; + die "Sort descending (sort -ru) and rerun this script.\n"; + } + $lastscore = $fp{compact}; # populate records hash $recs{ $fp{id} }{ $fp{sha1} } = {}; -- 1.7.2.5