summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/result
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-09-09 23:04:49 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-09-09 23:04:49 +0200
commitdc06b30f6a1861b5c25ae0c2d50865d053ebdffa (patch)
treefcd04ed88a458aba1dd1011cae3c52767b670d2f /container-search/src/main/java/com/yahoo/search/result
parent5381ce1b3f336a09ecf8fe6e991d1fa2b12282d6 (diff)
Propagate listeners
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/result')
-rw-r--r--container-search/src/main/java/com/yahoo/search/result/HitGroup.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
index a12a2566f68..056976724bb 100644
--- a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
+++ b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
@@ -500,15 +500,15 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
if (hit.isAuxiliary()) continue;
currentIndex++;
- if (currentIndex < offset || currentIndex >= highBound) {
+ if (currentIndex < offset || currentIndex >= highBound)
handleRemovedHit(hit);
- }
}
if ((offset > 0) || (hits.size() > highBound)) {
ListenableArrayList<Hit> newHits = new ListenableArrayList<>(numHits);
- for (int index = offset; index < Math.min(highBound, hits.size()); index++) {
+ for (int index = offset; index < Math.min(highBound, hits.size()); index++)
newHits.add(hits.get(index));
- }
+ for (Runnable listener : hits.listeners())
+ newHits.addListener(listener);
hits = newHits;
unmodifiableHits = Collections.unmodifiableList(hits);
}
@@ -842,7 +842,7 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
Hit hitClone = i.next().clone();
hitGroupClone.hits.add(hitClone);
}
- if (this.errorHit!=null) { // Find the cloned error and assign it
+ if (this.errorHit != null) { // Find the cloned error and assign it
for (Hit hit : hitGroupClone.asList()) {
if (hit instanceof DefaultErrorHit)
hitGroupClone.errorHit=(DefaultErrorHit)hit;
@@ -874,7 +874,7 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
/*
This is an optimisation to avoid creating many temporary hash sets in the happy path.
The simple naive implementation is
- Set<String> filled = null;
+ Set<String> filled = null;
for (Hit hit : hits) {
if (hit.getFilled() == null) continue;
if (filled == null)
@@ -883,7 +883,7 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
filled.retainAll(hit.getFilled());
}
return filled;
- */
+ */
Iterator<Hit> iterator = hits.iterator();
Set<String> firstSummaryNames = getSummaryNamesNextFilledHit(iterator);
if (firstSummaryNames == null || firstSummaryNames.isEmpty())