Skip to content

Commit

Permalink
fixed regression in speed when searching in nodes names and tags, no …
Browse files Browse the repository at this point in the history
…nodes contents, after v1.0.2 (#2408)
  • Loading branch information
giuspen committed Dec 21, 2023
1 parent 91600e2 commit b44bde7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/ct/ct_actions_find.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ void CtActions::find_in_multiple_nodes()
while (node_iter) {
_s_state.all_matches_first_in_node = true;
CtTreeIter ct_node_iter = ctTreeStore.to_ct_tree_iter(node_iter);
Glib::RefPtr<Gsv::Buffer> rTextBuffer = ct_node_iter.get_node_text_buffer();
if (not rTextBuffer) {
CtDialogs::error_dialog(str::format(_("Failed to retrieve the content of the node '%s'"), ct_node_iter.get_node_name()), *_pCtMainWin);
break;
if (_s_options.node_content) {
Glib::RefPtr<Gsv::Buffer> rTextBuffer = ct_node_iter.get_node_text_buffer();
if (not rTextBuffer) {
CtDialogs::error_dialog(str::format(_("Failed to retrieve the content of the node '%s'"), ct_node_iter.get_node_name()), *_pCtMainWin);
break;
}
}
while (_parse_given_node_content(ct_node_iter, re_pattern, forward, first_fromsel, all_matches)) {
++_s_state.matches_num;
Expand Down Expand Up @@ -385,10 +387,12 @@ bool CtActions::_parse_given_node_content(CtTreeIter node_iter,
while (child_iter and not _pCtMainWin->get_status_bar().is_progress_stop()) {
_s_state.all_matches_first_in_node = true;
CtTreeIter ct_node_iter = ctTreeStore.to_ct_tree_iter(child_iter);
Glib::RefPtr<Gsv::Buffer> rTextBuffer = ct_node_iter.get_node_text_buffer();
if (not rTextBuffer) {
CtDialogs::error_dialog(str::format(_("Failed to retrieve the content of the node '%s'"), ct_node_iter.get_node_name()), *_pCtMainWin);
break;
if (_s_options.node_content) {
Glib::RefPtr<Gsv::Buffer> rTextBuffer = ct_node_iter.get_node_text_buffer();
if (not rTextBuffer) {
CtDialogs::error_dialog(str::format(_("Failed to retrieve the content of the node '%s'"), ct_node_iter.get_node_name()), *_pCtMainWin);
break;
}
}
while (_parse_given_node_content(ct_node_iter, re_pattern, forward, first_fromsel, all_matches)) {
_s_state.matches_num += 1;
Expand Down

0 comments on commit b44bde7

Please sign in to comment.