From f20a91e9d59a836a80dd6e90adee1bf1de408ca5 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 12 Dec 2017 05:42:21 +0300 Subject: [PATCH] Count matches only within cycles --- zipper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zipper.cpp b/zipper.cpp index 1561dcf..b13ae34 100644 --- a/zipper.cpp +++ b/zipper.cpp @@ -337,6 +337,8 @@ int main(int argc, char** argv) { zip_samples.push_back(zip_samples[add_index]); // same sample, referencing previous copy goto sample_added; } else { + cycleN_count.clear(); // reset all matches counters + cycle_size_max = 0; for (unsigned c = 0; c < zip_samples.size(); c++) { if (zip_samples[c].size() == static_cast(zip_length)) { if (memcmp(zip_samples[c].data(), zip_pass1[0].data(), zip_length) == 0) { @@ -359,8 +361,6 @@ int main(int argc, char** argv) { minimal_zip_passes = pass_counter; // p + 1 } match_counter = 0; - cycleN_count.clear(); // reset all matches counters - cycle_size_max = 0; sample_added: if (!line_start) std::cout << "." << std::endl; } else