File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ void manual_move_cost_summary_dialog() {
212212 gtk_window_set_transient_for ((GtkWindow*)dialog, (GtkWindow*)draw_state->manual_moves_state .manual_move_window );
213213
214214 // Create elements for the dialog and printing costs to the user.
215- GtkWidget* title_label = gtk_label_new (NULL );
215+ GtkWidget* title_label = gtk_label_new (nullptr );
216216 gtk_label_set_markup ((GtkLabel*)title_label, " <b>Move Costs and Outcomes</b>" );
217217 std::string delta_cost = " Delta Cost: " + std::to_string (draw_state->manual_moves_state .manual_move_info .delta_cost ) + " " ;
218218 GtkWidget* delta_cost_label = gtk_label_new (delta_cost.c_str ());
Original file line number Diff line number Diff line change 1616bool f_placer_breakpoint_reached = false ;
1717
1818// Records counts of reasons for aborted moves
19- static std::map<std::string, size_t > f_move_abort_reasons;
19+ static std::map<std::string, size_t , std::less<> > f_move_abort_reasons;
2020
21- void log_move_abort (const std::string& reason) {
22- ++f_move_abort_reasons[reason];
21+ void log_move_abort (std::string_view reason) {
22+ auto it = f_move_abort_reasons.find (reason);
23+ if (it != f_move_abort_reasons.end ()) {
24+ it->second ++;
25+ } else {
26+ f_move_abort_reasons.emplace (reason, 1 );
27+ }
2328}
2429
2530void report_aborted_moves () {
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ struct t_range_limiters {
8686};
8787
8888// Records a reasons for an aborted move
89- void log_move_abort (const std::string& reason);
89+ void log_move_abort (std::string_view reason);
9090
9191// Prints a breif report about aborted move reasons and counts
9292void report_aborted_moves ();
You can’t perform that action at this time.
0 commit comments