8067969: Optimize Stream.count for SIZED Streams

Reviewed-by: psandoz, chegar
This commit is contained in:
Aggelos Biboudis 2015-03-16 10:19:49 +01:00 committed by Paul Sandoz
parent 2349ff99bc
commit cb566c6ce5
11 changed files with 368 additions and 31 deletions

View file

@ -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