private void run_filter(bool run_on_full_log) { filter_func item_filter; lock (this) item_filter = this.item_filter; bool quick_filter_matches_all = quick_filter_.matches_all(); if (item_filter == null && quick_filter_matches_all) { return; } memory_optimized_list <int> line_indexes = new memory_optimized_list <int>() { min_capacity = app.inst.no_ui.min_list_data_source_capacity }; var items = run_on_full_log ? full_log_items : items_; int count = items.count; for (int idx = 0; idx < count; ++idx) { match_item i; if (!run_on_full_log) { i = items.match_at(idx) as match_item; } else { // at this point - we're run on the full log - however, if we find an item that exists in current view, use that // (so that we can reference the matches) i = items.match_at(idx) as match_item; var in_cur_view = items_.binary_search(i.line_idx).Item1 as match_item; if (in_cur_view != null) { i = in_cur_view; } } // possible optimization: // if the new quick filter is a subset of the former filter, I should run it only on the former sorted_line_indexes if (quick_filter_matches_all || quick_filter_.matches(i)) { if (item_filter == null || item_filter(i, run_on_full_log)) { if (i.line_idx >= 0) { line_indexes.Add(i.line_idx); } } } } lock (this) sorted_line_indexes_ = line_indexes; }
private void run_filter(bool run_on_full_log) { filter_func item_filter; lock (this) item_filter = this.item_filter; Debug.Assert(item_filter != null); if (item_filter == null) { return; } memory_optimized_list <int> line_indexes = new memory_optimized_list <int>() { min_capacity = app.inst.no_ui.min_list_data_source_capacity }; var items = run_on_full_log ? full_log_items : items_; int count = items.count; for (int idx = 0; idx < count; ++idx) { match_item i; if (!run_on_full_log) { i = items.match_at(idx) as match_item; } else { // at this point - we're run on the full log - however, if we find an item that exists in current view, use that // (so that we can reference the matches) i = items.match_at(idx) as match_item; var in_cur_view = items_.binary_search(i.line_idx).Item1 as match_item; if (in_cur_view != null) { i = in_cur_view; } } if (item_filter(i, run_on_full_log)) { if (i.line_idx >= 0) { line_indexes.Add(i.line_idx); } } } lock (this) sorted_line_indexes_ = line_indexes; }
private void run_filter(bool run_on_full_log) { filter_func item_filter; lock (this) item_filter = this.item_filter; Debug.Assert(item_filter != null); if (item_filter == null) return; memory_optimized_list<int> line_indexes = new memory_optimized_list<int>() { min_capacity = app.inst.no_ui.min_list_data_source_capacity }; var items = run_on_full_log ? full_log_items : items_; int count = items.count; for (int idx = 0; idx < count; ++idx) { match_item i; if (!run_on_full_log) i = items.match_at(idx) as match_item; else { // at this point - we're run on the full log - however, if we find an item that exists in current view, use that // (so that we can reference the matches) i = items.match_at(idx) as match_item; var in_cur_view = items_.binary_search(i.line_idx).Item1 as match_item; if (in_cur_view != null) i = in_cur_view; } if ( item_filter(i, run_on_full_log)) if ( i.line_idx >= 0) line_indexes.Add( i.line_idx); } lock (this) sorted_line_indexes_ = line_indexes; }
private void run_filter(bool run_on_full_log) { filter_func item_filter; lock (this) item_filter = this.item_filter; bool quick_filter_matches_all = quick_filter_.matches_all(); if (item_filter == null && quick_filter_matches_all) return; memory_optimized_list<int> line_indexes = new memory_optimized_list<int>() { min_capacity = app.inst.no_ui.min_list_data_source_capacity }; var items = run_on_full_log ? full_log_items : items_; int count = items.count; for (int idx = 0; idx < count; ++idx) { match_item i; if (!run_on_full_log) i = items.match_at(idx) as match_item; else { // at this point - we're run on the full log - however, if we find an item that exists in current view, use that // (so that we can reference the matches) i = items.match_at(idx) as match_item; var in_cur_view = items_.binary_search(i.line_idx).Item1 as match_item; if (in_cur_view != null) i = in_cur_view; } // possible optimization: // if the new quick filter is a subset of the former filter, I should run it only on the former sorted_line_indexes if ( quick_filter_matches_all || quick_filter_.matches(i)) if ( item_filter == null || item_filter(i, run_on_full_log)) if ( i.line_idx >= 0) line_indexes.Add( i.line_idx); } lock (this) sorted_line_indexes_ = line_indexes; }