summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/Iterator.scala
Commit message (Collapse)AuthorAgeFilesLines
* Nuance doc for slidingSom Snytt2017-02-071-24/+35
| | | | Attempt to clarify how final element is handled.
* Typo and spelling correctionsJanek Bogucki2016-11-111-2/+2
|
* Merge commit 'b9a16c4' into 2.12.xJason Zaugg2016-11-081-13/+10
|\
| * SI-9913 Tighten bolts on span iteratorSom Snytt2016-09-061-13/+10
| | | | | | | | | | Extra privacy, and the tricky state transition is made more tabular.
| * SI-9913 Lead span iterator finishes at state -1Som Snytt2016-09-051-1/+1
| | | | | | | | | | Even if no elements fail the predicate (so that the trailing iterator is empty).
| * SI-9766 - allow ++ on empty ConcatIteratorMartijn Hoekstra2016-05-211-1/+2
| |
* | Replace JoinIterator & improve ConcatIteratorStefan Zeiger2016-03-111-44/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new `ConcatIterator` requires only one extra lightweight wrapper object (cons cell) to be allocated compared to `JoinIterator`. All additional concatenations are then done in place with one cons cell per appended iterator. Running 1000000 iterations of the following benchmark for LHS recursion: ``` def lhs(n: Int) = (1 to n).foldLeft(Iterator.empty: Iterator[Int])((res, _) => res ++ Iterator(1)).sum ``` On 2.12.x before SI-9623 fix: ``` $ ../scala/build-sbt/quick/bin/scala -J-Xmx1024M -nc concatit.scala 1000000: 555ms 1000000: 344ms 1000000: 397ms 1000000: 309ms 1000000: 290ms 1000000: 283ms 1000000: 282ms 1000000: 281ms 1000000: 290ms 1000000: 279ms ``` With SI-9623 fix: ``` $ ../scala/build-sbt/quick/bin/scala -J-Xmx1024M -nc concatit.scala 1000000: 610ms 1000000: 324ms 1000000: 387ms 1000000: 315ms 1000000: 296ms 1000000: 300ms 1000000: 341ms 1000000: 294ms 1000000: 291ms 1000000: 281ms ``` With this version: ``` $ ../scala/build-sbt/quick/bin/scala -J-Xmx1024M -nc concatit.scala 1000000: 362ms 1000000: 162ms 1000000: 140ms 1000000: 150ms 1000000: 110ms 1000000: 57ms 1000000: 79ms 1000000: 109ms 1000000: 120ms 1000000: 49ms ``` And for RHS recursion: ``` def rhs(n: Int) = (1 to n).foldLeft(Iterator.empty: Iterator[Int])((res, _) => Iterator(1) ++ res).sum ``` On 2.12.x before SI-9623 fix: ``` StackOverflowError ``` With SI-9623 fix: ``` StackOverflowError ``` With this version: ``` $ ../scala/build-sbt/quick/bin/scala -J-Xmx1024M -nc concatit.scala 1000000: 3156ms 1000000: 1536ms 1000000: 1240ms 1000000: 1575ms 1000000: 439ms 1000000: 706ms 1000000: 1043ms 1000000: 1211ms 1000000: 515ms 1000000: 314ms ```
* | Merge branch '2.11.x' into topic/merge-2.11.x-to-2.12.x-20160210Jason Zaugg2016-02-101-6/+45
|\| | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/Iterator.scala | `-- trivial conflicts only. Parens were added to the next() calls in 2.12.x, while in the meantime `{Concat,Join}Iterator` were optimized in 2.11.x
| * SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIteratorStefan Zeiger2016-02-011-6/+45
| | | | | | | | | | | | | | | | | | | | | | These iterator implementations are used to concatenate two (JoinIterator) or more (ConcatIterator) other iterators with `++`. They used to perform many unnecessary calls to the child iterators’ `hasNext` methods. This improved state machine-based implementation reduces that number to the bare minimum, i.e. iterating over concatenated iterators with `foreach` calls the children's `hasNext` methods a total of (number of children) + (number of elements) times, the same as when iterating over all children separately.
* | Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-181-9/+7
| | | | | | | | | | | | | | | | | | | | - Language imports are preceding other imports - Deleted empty file: InlineErasure - Removed some unused private[parallel] methods in scala/collection/parallel/package.scala This removes hundreds of warnings when compiling with "-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
* | Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-241-1/+1
|\|
| * Conform foreach tparam to majority naming conventionvsalvis2015-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'U' is the common choice for the foreach function result tparam. This command summarises the naming diversity before and after this change. $ fgrep -r 'def foreach[' *|cut -f2 -d:|cut -f1 -d'('|tr -s ' '|sed 's/override //g'|sort|uniq -c|sort -nr Before, 80 def foreach[U] 6 def foreach[C] 6 def foreach[B] 4 final def foreach[U] 3 def foreach[S] 2 inline final def foreach[U] 2 def foreach[A] 1 inline final def foreach[specialized 1 final def foreach[B] 1 * def foreach[U] 1 def foreach[Q] 1 def foreach[D] 1 def foreach[A,B,U] After, 98 def foreach[U] 5 final def foreach[U] 2 inline final def foreach[U] 1 inline final def foreach[specialized 1 * def foreach[U] 1 def foreach[A,B,U] (@ symbols removed.)
* | Merge commit 'a170c99' into 2.12.xLukas Rytz2015-09-221-59/+162
|\|
| * Performance optimization - Iterator span, collect, dropWhileRex Kerr2015-08-071-35/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite of span to avoid double-indirection of `.buffered` and to avoid use of `mutable.Queue` unless it is absolutely necessary. Rewrite of `span` and `dropWhile` to also avoid `.buffered` (less DRY but single vs. double indirection and object allocation). Performance improvements: ``` method reason =========== =============================================================== collect 2.3x faster on small collections, 1.5x on large span 1.6-1.7x faster on small collections 0.85x-1.8x slower/faster on large collections depending on how much must be cached (0.85x all, 1.8x none) dropWhile 1.2x faster on small collections, half the garbage ```
| * Performance optimization - Iterator flatMap, find, indexWhere, indexOfRex Kerr2015-08-071-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tightened up bytecode, logic, and/or performance by using local return instead of a mutable variable in several methods. Performance/bytecode size improvements (smaller bytecode = better inlining) ``` method reason =========== =============================================================== flatMap hasNext bytecode 34 bytes down from 62 find bytecode 41 bytes instead of 53 indexWhere 1.5x faster on small collections (some contexts) indexOf bytecode 89 bytes instead of 110 ```
* | Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624Jason Zaugg2015-06-241-20/+12
|\|
| * SI-9332 Iterator.span simplifiedSom Snytt2015-05-271-15/+12
| | | | | | | | | | | | | | The queue is only used when the prefix is drained by finish. Since a finished flag has been introduced, distinguish between the drained state and using the underlying (buffered) iterator.
| * SI-9332 Iterator.span exhausts leading iteratorSom Snytt2015-05-271-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the leading and trailing iterators returned by span share the underlying iterator, the leading iterator must flag when it is exhausted (when the span predicate fails) since the trailing iterator will advance the underlying iterator. It would also be possible to leave the failing element in the leading lookahead buffer, where it would forever fail the predicate, but that entails evaluating the predicate twice, on both enqueue and dequeue.
* | SI-8627 Two-argument indexOf does not work for IteratorRui Gonçalves2015-04-041-2/+37
| | | | | | | | Adds two new methods to `Iterator`, overloading `indexOf` and `indexWhere` with a two-arg version whose second argument indicates the index where to start the search. These methods were already present in instances of `GenSeqLike` but not on iterators, leading to strange behavior when two arguments were passed to `indexOf`.
* | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-01-291-3/+3
|\| | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150129 Conflicts: build.number src/library/scala/concurrent/Future.scala versions.properties
| * Fix many typos in docs and commentsmpociecha2014-12-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit corrects many typos found in scaladocs, comments and documentation. It should reduce a bit number of PRs which fix one typo. There are no changes in the 'real' code except one corrected name of a JUnit test method and some error messages in exceptions. In the case of typos in other method or field names etc., I just skipped them. Obviously this commit doesn't fix all existing typos. I just generated in IntelliJ the list of potential typos and looked through it quickly.
* | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-291-1/+8
|\| | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * SI-8835 Iterator tests can be junitSom Snytt2014-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | Without loss of generality or convenience, but helps reduce the number of files in test/files and may reduce compile times for test suite. This commit includes the fix from #3963 and an extra test of that fix that ensures the stack doesn't grow on chained drops.
| * SI-8835 Fix implementation of Iterator drop to remove quadratic behaviorErik Erlandson2014-10-211-1/+8
| |
* | SI-7128 copyToArray(xs, 0, 0) should not failRex Kerr2015-01-081-2/+1
| | | | | | | | | | | | | | | | | | | | Fixed all copyToArray methods to do exactly what the docs say they do, with the least-suprise behavior of not throwing an exception if you ask to copy nothing (but would have copied out of range). Iterator had an undocumented requirement for the target index to be in range regardless if anything happened; this has been removed.
* | SI-8835 Lazier slice for IteratorSom Snytt2014-11-131-22/+61
|/ | | | | | | | | | | | | | | | | | | | | An iterator for slicing that does not drop eagerly. A series of `take m drop n` that results in nothing taken will not call the underlying iterator. Chained invocations do not create intermediate iterators. This PR against 2.12 (because of the change to laziness) does not include the expanded unit test from #4075. Fix the parallel iterable splitter, which overrides `take` and `slice`, to also override `drop`. Drop is now eager there, like the drop of slice. Enhance `stringOf` to handle `ParIterable` again. A commit from a previous decade added that under the aegis of `Iterable`. As of 2.11, `stringOf((0 until 512).to[Vector].par, 10)` does not truncate.
* SI-8474 Inconsistent behavior of patch methodRex Kerr2014-08-241-11/+29
| | | | | | | | Changed Iterator to be consistent with other collections. Also fixed SeqViewLike to validate/constrain inputs. No specific tests; quasi-comprehensive collection tests will cover this later.
* SI-8475 GroupedIterator is also lazy when paddedSom Snytt2014-05-271-6/+7
| | | | | | | | This is the related case which dnlgtm in the previous fix. The old code seems to be tilting for laziness, but we have to fill the buffer with the current group anyway, so there is no reason to be coy about calling ArrayBuffer.length.
* SI-8475 Fix off by one in GroupedIterator when StreamingJean-Remi Desjardins2014-05-091-1/+3
| | | | This also affected sliding and grouped since they defer to GroupedIterator
* SI-8428 Refactor ConcatIteratorJason Zaugg2014-03-241-5/+5
| | | | | Make the head iterator a constructor parameter, for easier construction and implementation of ++.
* SI-8428 Fix regression in iterator concatenationJason Zaugg2014-03-201-1/+1
| | | | | | | | | | | | | | | Regressed in e3ddb2d7, which introduced `ConcatIterator` to avoid super-linear runtime on chains of concatenated iterators. `ConcatIterator` maintains a queue of thunks for the remaining iterators. Both `next` and `hasNext` delegate to `advance`, which evaluates the thunks and discards any empty iterators from the start of the queue. The first non-empty iterator is stored in the var `current`. It also overrides `++`, and creates a new `ConcatIterator` with the given `that` as an extra element in the queue. However, it failed to copy `current` across, which led to data loss.
* SI-6948 Make the Abstract* classes public.Paul Phillips2014-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several weaknesses in the implementation converge and force multiply. 1) Type constructor inference is not persistent. During implicit search it will give up after the first seen parent even if some deeper base type (even another direct parent) would satisfy the search. 2) Type inference is not aware of access restrictions. Inferred types are calculated with disregard for whether the inferred type is visible at the point of inference. That means that package-private types - which may be private for any number of good reasons, such as not wanting them to appear in bytecode thus creating binary compatibility obligations - are not private. There is no such thing as a qualified private type. package p { trait PublicInterface[T] { def foo(): Int } private[p] trait ImplementationOnly[T] extends PublicInterface[T] { def foo(): Int = 1 } class PublicClass extends ImplementationOnly[PublicClass] } package q { object Test { def f[A, CC[X]](xs: CC[A]): CC[A] = xs def g = f(new p.PublicClass) // inferred type: p.ImplementationOnly[p.PublicClass] def h = g.foo() // Bytecode contains: // public p.ImplementationOnly<p.PublicClass> g(); // public int h(); // 0: aload_0 // 1: invokevirtual #30 // Method g:()Lp/ImplementationOnly; // 4: invokeinterface #33, 1 // InterfaceMethod p/ImplementationOnly.foo:()I // 9: ireturn } } 3) The trait encoding leads to a proliferation of forwarder methods, so much so that 1.5 Mb of bytecode was taken off of the standard library size by creating abstract classes which act as central mixin points so that leaf classes can inherit some methods the old fashioned way rather than each receiving their own copy of every trait defined method. This was done for 2.10 through the creation of the Abstract* classes, all of which were given reduced visibility to keep them out of the API. private[collection] class AbstractSeq extends ... This achieved its intended goal very nicely, but also some unintended ones. In combination with 1) above: scala> val rand = new scala.util.Random() rand: scala.util.Random = scala.util.Random@7f85a53b // this works scala> rand.shuffle(0 to 5) res1: scala.collection.immutable.IndexedSeq[Int] = Vector(4, 0, 1, 2, 5, 3) // and this doesn't! good luck reasoning that one out scala> rand.shuffle(0 until 5) <console>:9: error: Cannot construct a collection of type scala.collection.AbstractSeq[Int] with elements of type Int based on a collection of type scala.collection.AbstractSeq[Int]. rand.shuffle(0 until 5) ^ // Somewhat comically, in scala 2.9 it was flipped: to failed (differently), until worked. scala> scala.util.Random.shuffle(0 to 5) <console>:8: error: type mismatch; found : scala.collection.immutable.Range.Inclusive required: ?CC[?T] scala> scala.util.Random.shuffle(0 until 5) res2: scala.collection.immutable.IndexedSeq[Int] = Vector(4, 3, 1, 2, 0) In combination with 2) above: scala> def f[A, CC[X]](xs: CC[A]): CC[A] = xs f: [A, CC[X]](xs: CC[A])CC[A] scala> var x = f(1 until 10) x: scala.collection.AbstractSeq[Int] = Range(1, 2, 3, 4, 5, 6, 7, 8, 9) // It has inferred a type for our value which it will not allow us to use or even to reference. scala> var y: scala.collection.AbstractSeq[Int] = x <console>:10: error: class AbstractSeq in package collection cannot be accessed in package collection var y: scala.collection.AbstractSeq[Int] = x ^ // This one is a straight regression - in scala 2.9, scala> var x = f(1 until 10) x: scala.collection.immutable.IndexedSeq[Int] = Range(1, 2, 3, 4, 5, 6, 7, 8, 9) Since 1) and 2) are essentially unfixable - at least by me - I propose to ameliorate these regressions by attacking the symptoms at the leaves. That means making all the Abstract* classes public - keeping in mind that they must already be assumed to be in the binary compatibility footprint, since they have been leaking throughout their existence. This only impacts the inference of inaccessible collections types - it doesn't help with the more serious issue with type inference.
* Iterator.++ no longer blows the stack.Paul Phillips2013-03-261-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To my chagrin we still hadn't gotten this one. I took a new approach which seems like a winner to me. Here's a benchmark: object Test { def run(n: Int) = println((1 to n).foldLeft(Iterator.empty: Iterator[Int])((res, _) => res ++ Iterator(1)) sum) def main(args: Array[String]): Unit = run(args(0).toInt) } Runtime before this commit for various n: 500 0.403 real 1000 0.911 real 1500 2.351 real 2000 5.298 real 2500 10.184 real Runtime after this commit, same n: 500 0.346 real 1000 0.359 real 1500 0.368 real 2000 0.379 real 2500 0.390 real In the test case I dial it up to 100000.
* Doc -> C-style comments for local symbols to avoid "discardingEugene Vigdorchik2013-03-211-1/+1
| | | | | unmoored doc comment" warning when building distribution for scala itself.
* Merge branch 2.10.1 into masterAdriaan Moors2013-02-271-1/+1
|\ | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/Trees.scala src/library/scala/concurrent/impl/ExecutionContextImpl.scala
| * SI-7128 Fix regression in copyToArray for empty arraysJason Zaugg2013-02-141-1/+1
| |
| * Fix Iterator#copyToArray (fixes SI-6827).Erik Osheim2013-01-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in #scala, when using a non-zero start it's possible to get an ArrayIndexOutOfBoundsException due to an incorrect bounds check. This patch fixes this, as well as another potential bounds error, and adds test cases. Incorporates some other suggestions by Som-Snytt to ensure that callers will get useful error messages in cases where the start parameter is wrong (negative or out-of-array-bounds). Review by @som-snytt.
* | More explicit empty paren lists in method calls.Jason Zaugg2013-02-241-9/+9
| |
* | Fix Iterator#copyToArray (fixes SI-6827).Erik Osheim2012-12-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in #scala, when using a non-zero start it's possible to get an ArrayIndexOutOfBoundsException due to an incorrect bounds check. This patch fixes this, as well as another potential bounds error, and adds test cases. Incorporates some other suggestions by Som-Snytt to ensure that callers will get useful error messages in cases where the start parameter is wrong (negative or out-of-array-bounds). Review by @som-snytt.
* | Merge commit 'refs/pull/1574/head' into merge-210Paul Phillips2012-11-051-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1574/head': (24 commits) Fixing issue where OSGi bundles weren't getting used for distribution. Fixes example in Type.asSeenFrom Fix for SI-6600, regression with ScalaNumber. SI-6562 Fix crash with class nested in @inline method Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013 Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013 SI-6606 Drops new icons in, replaces abstract types placeholder icons SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings Labeling scala.reflect and scala.reflect.macros experimental in the API docs Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later SI-6399 Adds API docs for Any and AnyVal Removing actors-migration from main repository so it can live on elsewhere. Fix for SI-6597, implicit case class crasher. SI-6578 Harden against synthetics being added more than once. SI-6556 no assert for surprising ctor result type Removing actors-migration from main repository so it can live on elsewhere. Fixes SI-6500 by making erasure more regular. Modification to SI-6534 patch. Fixes SI-6559 - StringContext not using passed in escape function. ... Conflicts: src/actors-migration/scala/actors/migration/StashingActor.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/library/scala/Application.scala src/library/scala/collection/immutable/GenIterable.scala.disabled src/library/scala/collection/immutable/GenMap.scala.disabled src/library/scala/collection/immutable/GenSeq.scala.disabled src/library/scala/collection/immutable/GenSet.scala.disabled src/library/scala/collection/immutable/GenTraversable.scala.disabled src/library/scala/collection/mutable/GenIterable.scala.disabled src/library/scala/collection/mutable/GenMap.scala.disabled src/library/scala/collection/mutable/GenSeq.scala.disabled src/library/scala/collection/mutable/GenSet.scala.disabled src/library/scala/collection/mutable/GenTraversable.scala.disabled src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
| * Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
| |
* | Remove unused private members.Paul Phillips2012-11-011-2/+0
|/ | | | | | | | | That's a lot of unused code. Most of this is pure cruft; a small amount is debugging code which somebody might want to keep around, but we should not be using trunk as a repository of our personal snippets of undocumented, unused, unintegrated debugging code. So let's make the easy decision to err in the removing direction. If it isn't built to last, it shouldn't be checked into master.
* Merge pull request #1308 from soc/SI-4478Josh Suereth2012-09-171-1/+1
|\ | | | | SI-4478 Replaces wrt with (hopefully) slightly improved wording.
| * SI-4478 Replaces wrt with (hopefully) slightly improved wording.Simon Ochsenreither2012-09-151-1/+1
| |
* | More relative path elimination.Paul Phillips2012-09-151-1/+2
|/ | | | | | | | | | | | | | | | Some names I missed in 55b609458fd . How one might know when one is done: mkdir scratch && cd scratch mkdir annotation beans collection compat concurrent io \ math parallel ref reflect runtime scala sys testing \ text tools util xml scalac $(find ../src/library -name '*.scala') Until recently that would fail with about a billion errors. When it compiles, that's when you're done. And that's where this commit takes us, for src/library at least.
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* Migrate build to @odersky's suggestion of convertTo.Josh Suereth2012-06-181-7/+0
| | | | | | * Move method into TraversableOnce from Iterator and Traversable to make the build pass. * Udpate IDE tests with new collection methods. * Rewire default toXYZ methods to use convertTo.
* Rename copyTo to build based on consensus of 3Josh Suereth2012-06-181-2/+2
|
* Fixes from review.Josh Suereth2012-06-181-2/+2
| | | | | | * Fixed typo * Renamed copyInto to copyTo * Added tparam doc.
* Adding copyInto and toVector methods to collections.Josh Suereth2012-06-181-0/+10
| | | | | * Added generic copyInto method for collections. For any collection with a CanBuildFrom, can convert a generic collection into it using the builder. * Added specifici toVector method for collections. This is more efficient than copyInto if the collection is a Vector.