Просмотр исходного кода

Even more cleanup (unused functionality)

devmil 4 лет назад
Родитель
Сommit
b4d64d10a5
1 измененных файлов с 1 добавлено и 15 удалено
  1. 1 15
      lib/terminal/terminal_search.dart

+ 1 - 15
lib/terminal/terminal_search.dart

@@ -8,27 +8,13 @@ import 'package:xterm/util/constants.dart';
 /// It stores the hits the search produced and the navigation state inside
 /// the search results
 class TerminalSearchResult {
-  final _hitsByLine = Map<int, List<TerminalSearchHit>>();
   late final _allHits;
   int _currentSearchHit = 0;
 
   /// creates a new search result instance from the given hits
   TerminalSearchResult.fromHits(List<TerminalSearchHit> hits) {
     _allHits = hits;
-    for (final hit in hits) {
-      if (!_hitsByLine.containsKey(hit.startLineIndex)) {
-        _hitsByLine[hit.startLineIndex] =
-            List<TerminalSearchHit>.empty(growable: true);
-      }
-      if (!_hitsByLine.containsKey(hit.endLineIndex)) {
-        _hitsByLine[hit.endLineIndex] =
-            List<TerminalSearchHit>.empty(growable: true);
-      }
-      _hitsByLine[hit.startLineIndex]!.add(hit);
-      if (hit.startLineIndex != hit.endLineIndex) {
-        _hitsByLine[hit.endLineIndex]!.add(hit);
-      }
-    }
+
     if (_allHits.length > 0) {
       _currentSearchHit = _allHits.length;
     } else {