diff options
author | vsalvis <salvisbergvera@gmail.com> | 2015-06-29 18:56:06 +0200 |
---|---|---|
committer | Janek Bogucki <janekdb@gmail.com> | 2015-10-21 22:30:48 +0100 |
commit | 6ed701004550fa04b8ac2d3419f2ea4141c834ad (patch) | |
tree | e28689413c03483296511086654d17913dba969f /src/library/scala/collection/immutable/HashSet.scala | |
parent | cea7de026ddcf5aa846edc2b9e2e00b608acda2c (diff) | |
download | scala-6ed701004550fa04b8ac2d3419f2ea4141c834ad.tar.gz scala-6ed701004550fa04b8ac2d3419f2ea4141c834ad.tar.bz2 scala-6ed701004550fa04b8ac2d3419f2ea4141c834ad.zip |
Conform foreach tparam to majority naming convention
'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.)
Diffstat (limited to 'src/library/scala/collection/immutable/HashSet.scala')
-rw-r--r-- | src/library/scala/collection/immutable/HashSet.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/collection/immutable/HashSet.scala b/src/library/scala/collection/immutable/HashSet.scala index 27b2bfdde7..050e90b49b 100644 --- a/src/library/scala/collection/immutable/HashSet.scala +++ b/src/library/scala/collection/immutable/HashSet.scala @@ -53,7 +53,7 @@ class HashSet[A] extends AbstractSet[A] def iterator: Iterator[A] = Iterator.empty - override def foreach[U](f: A => U): Unit = { } + override def foreach[U](f: A => U): Unit = () def contains(e: A): Boolean = get0(e, computeHash(e), 0) @@ -215,7 +215,7 @@ object HashSet extends ImmutableSetFactory[HashSet] { private object EmptyHashSet extends HashSet[Any] { } private[collection] def emptyInstance: HashSet[Any] = EmptyHashSet - + // utility method to create a HashTrieSet from two leaf HashSets (HashSet1 or HashSetCollision1) with non-colliding hash code) private def makeHashTrieSet[A](hash0:Int, elem0:HashSet[A], hash1:Int, elem1:HashSet[A], level:Int) : HashTrieSet[A] = { val index0 = (hash0 >>> level) & 0x1f @@ -966,7 +966,7 @@ object HashSet extends ImmutableSetFactory[HashSet] { final override def getElem(cc: AnyRef): A = cc.asInstanceOf[HashSet1[A]].key } - override def foreach[U](f: A => U): Unit = { + override def foreach[U](f: A => U): Unit = { var i = 0 while (i < elems.length) { elems(i).foreach(f) |