Skip to content

Commit aa1f663

Browse files
committed
Reduce the number of times compute_stats runs by eliminating the times that it runs during session loading
1 parent 25c40b6 commit aa1f663

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Studio/Analysis/AnalysisTool.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,10 @@ bool AnalysisTool::compute_stats() {
539539
return true;
540540
}
541541

542+
if (session_->is_loading()) {
543+
return false;
544+
}
545+
542546
if (session_->get_non_excluded_shapes().size() == 0 || !session_->particles_present()) {
543547
return false;
544548
}
@@ -1523,6 +1527,8 @@ void AnalysisTool::update_pca_group_options() {
15231527
item_widget->setFlags(item_widget->flags() | Qt::ItemIsUserCheckable);
15241528
item_widget->setCheckState(Qt::Checked);
15251529
}
1530+
stats_ready_ = false;
1531+
compute_stats();
15261532
}
15271533

15281534
int count = ui_->pca_group_list->count();
@@ -1534,9 +1540,6 @@ void AnalysisTool::update_pca_group_options() {
15341540
ui_->pca_group_list->setMaximumHeight(ui_->pca_group_list->sizeHintForRow(0) * count + 2);
15351541

15361542
current_pca_group_values_ = values;
1537-
1538-
stats_ready_ = false;
1539-
compute_stats();
15401543
}
15411544

15421545
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)