@@ -695,8 +695,6 @@ update_program_result_t OeisManager::updateProgram(
695
695
optimizer.removeNops (existing);
696
696
optimizer.removeNops (p);
697
697
if (p == existing) {
698
- // Log::get().info("Skipping update for " + seq.id_str() + "
699
- // (unchanged)");
700
698
return result;
701
699
}
702
700
}
@@ -717,25 +715,24 @@ update_program_result_t OeisManager::updateProgram(
717
715
num_default_terms);
718
716
break ;
719
717
}
720
- if (checked.first .empty ()) {
718
+ // not better or the same after optimization?
719
+ if (checked.first .empty () || (!is_new && checked.second == existing)) {
721
720
return result;
722
721
}
723
722
724
723
// update result
725
724
result.updated = true ;
726
725
result.is_new = is_new;
726
+ result.program = checked.second ;
727
727
result.change_type = checked.first ;
728
728
if (!is_new) {
729
729
result.previous_hash = ProgramUtil::hash (existing, true );
730
730
}
731
731
732
732
// write new or better program version
733
- result.program = checked.second ;
734
- if (Setup::getMiningMode () == MINING_MODE_SERVER) {
735
- dumpProgram (id, result.program , global_file, submitted_by);
736
- } else {
737
- dumpProgram (id, result.program , local_file, submitted_by);
738
- }
733
+ const bool is_server = (Setup::getMiningMode () == MINING_MODE_SERVER);
734
+ const std::string target_file = is_server ? global_file : local_file;
735
+ dumpProgram (id, result.program , target_file, submitted_by);
739
736
740
737
// if not updating, ignore this sequence for future matches;
741
738
// this is important for performance: it is likly that we
0 commit comments