mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8067969: Optimize Stream.count for SIZED Streams
Reviewed-by: psandoz, chegar
This commit is contained in:
parent
2349ff99bc
commit
cb566c6ce5
11 changed files with 368 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -427,7 +427,7 @@ abstract class IntPipeline<E_IN>
|
|||
|
||||
@Override
|
||||
public final long count() {
|
||||
return mapToLong(e -> 1L).sum();
|
||||
return evaluate(ReduceOps.makeIntCounting());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue