diff options
author | Lars Vogel | 2019-06-18 09:16:32 +0000 |
---|---|---|
committer | Lars Vogel | 2019-06-18 09:16:32 +0000 |
commit | 784c9608a760e3ffac6d43c77cdde0bc2f5f8760 (patch) | |
tree | 8908c7607dd1853447ca433c5faeac41ce3b137c /org.eclipse.search | |
parent | 3e59edd77535744f1ee0a23a8db5be99d7d3f8c9 (diff) | |
download | eclipse.platform.text-784c9608a760e3ffac6d43c77cdde0bc2f5f8760.tar.gz eclipse.platform.text-784c9608a760e3ffac6d43c77cdde0bc2f5f8760.tar.xz eclipse.platform.text-784c9608a760e3ffac6d43c77cdde0bc2f5f8760.zip |
Use addAll, deleteAll instead of looping through a collectionI20190623-1800I20190621-1800I20190620-1800I20190620-0130I20190619-1820I20190619-1800
Change-Id: I35edd6a934a0f65f357a54e710c77c190706bb45
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.search')
-rw-r--r-- | org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java index 55932b916d8..d5b28d11dda 100644 --- a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java +++ b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java @@ -15,6 +15,7 @@ package org.eclipse.search.ui.text; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -1352,18 +1353,14 @@ public abstract class AbstractTextSearchViewPage extends Page implements ISearch private void collectAllMatches(HashSet<Match> set, Object[] elements) { for (Object element : elements) { Match[] matches = getDisplayedMatches(element); - for (Match match : matches) { - set.add(match); - } + Collections.addAll(set, matches); } } private void collectAllMatchesBelow(AbstractTextSearchResult result, Set<Match> set, ITreeContentProvider cp, Object[] elements) { for (Object element : elements) { Match[] matches = getDisplayedMatches(element); - for (Match match : matches) { - set.add(match); - } + Collections.addAll(set, matches); Object[] children = cp.getChildren(element); collectAllMatchesBelow(result, set, cp, children); } |