scala/scala — pull request #3963 by erikerlandson (2014-09-04 18:12:24+00:00)
Title: SI-8835 Fix implementation of Iterator drop to remove quadratic behavior

The Iterator drop method (defined in Iterator.scala) generates nested anonymous classes. When drop is used in a loop, this causes linear traversal to become quadratic, and will also eventually cause a stack overflow if invoked sufficiently many times.

I wrote up a description and analysis of the problem here:
http://erikerlandson.github.io/blog/2014/09/03/matryoshka-class-construction-from-the-scala-iterator-drop-method/