summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/GenTraversableOnce.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/GenTraversableOnce.scala')
-rw-r--r--src/library/scala/collection/GenTraversableOnce.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala
index 4af2ca23be..f87f7654bc 100644
--- a/src/library/scala/collection/GenTraversableOnce.scala
+++ b/src/library/scala/collection/GenTraversableOnce.scala
@@ -96,6 +96,12 @@ trait GenTraversableOnce[+A] extends Any {
*/
def size: Int
+ /** The size of this $coll, if it can be cheaply computed
+ *
+ * @return the number of elements in this $coll, or -1 if the size cannot be determined cheaply
+ */
+ protected[collection] def sizeHintIfCheap: Int = -1
+
/** Tests whether the $coll is empty.
*
* Note: Implementations in subclasses that are not repeatedly traversable must take