Update pom.xml, CompletableFutureUtils.java, and FloatPriorityQueue.java
This commit is contained in:
parent
37bbafdfbf
commit
0d566b88b0
2
pom.xml
2
pom.xml
@ -68,7 +68,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>17.0.0</version>
|
||||
<version>19.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
@ -184,8 +184,8 @@ public class CompletableFutureUtils {
|
||||
public static <T> CompletableFuture<FloatPriorityQueue<T>> aggregatePq(Collection<CompletableFuture<FloatPriorityQueue<T>>> futureFloatPriorityQueues) {
|
||||
final CompletableFuture<FloatPriorityQueue<T>> identityAggregatedResult = CompletableFuture.completedFuture(new FloatPriorityQueue<>());
|
||||
|
||||
return futureFloatPriorityQueues.parallelStream().reduce(identityAggregatedResult, (currentAggregatedResult, futureFloatPriorityQueue) -> {
|
||||
return currentAggregatedResult.thenApplyAsync((aggregatedFloatPriorityQueue) -> {
|
||||
return futureFloatPriorityQueues.stream().reduce(identityAggregatedResult, (currentAggregatedResult, futureFloatPriorityQueue) -> {
|
||||
return currentAggregatedResult.thenApply((aggregatedFloatPriorityQueue) -> {
|
||||
var futureFloatPriorityQueueValues = futureFloatPriorityQueue.join();
|
||||
if (futureFloatPriorityQueueValues == aggregatedFloatPriorityQueue) {
|
||||
return aggregatedFloatPriorityQueue;
|
||||
|
@ -224,7 +224,9 @@ public class FloatPriorityQueue<T> implements Queue<T> {
|
||||
}
|
||||
|
||||
public boolean offer(ScoredValue<T> value) {
|
||||
assert contentValues.size() == internalQueue.size();
|
||||
int contentValuesSize = contentValues.size();
|
||||
int internalQueueSize = internalQueue.size();
|
||||
assert contentValuesSize == internalQueueSize;
|
||||
|
||||
boolean added = true;
|
||||
float oldValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user