Skip to content

Commit

Permalink
Count matches only within cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
VaKonS authored Dec 12, 2017
1 parent 2049b6a commit f20a91e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(zip_length)) {
if (memcmp(zip_samples[c].data(), zip_pass1[0].data(), zip_length) == 0) {
Expand All @@ -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
Expand Down

0 comments on commit f20a91e

Please sign in to comment.