diff options
author | Paul Phillips <paulp@improving.org> | 2013-06-08 12:04:27 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-06-08 12:04:27 -0700 |
commit | 45d61774eb255416c96e983cdb87960ad6415b74 (patch) | |
tree | 4aeb3debc1cf0a79ece22175f4be8450b607594b /src/reflect/scala/reflect/internal/Symbols.scala | |
parent | 04837e710552cc53b0b06b2bc47ee7d2856ae230 (diff) | |
download | scala-45d61774eb255416c96e983cdb87960ad6415b74.tar.gz scala-45d61774eb255416c96e983cdb87960ad6415b74.tar.bz2 scala-45d61774eb255416c96e983cdb87960ad6415b74.zip |
Eliminate needless Options.
Many of our core types have dedicated sentinels which serve
perfectly to communicate "no value", even more perfectly than
None. Saving a billion allocations is gravy.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Symbols.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index f3cea1fd00..2da9fa1cca 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -3413,6 +3413,9 @@ trait Symbols extends api.Symbols { self: SymbolTable => */ def mapParamss[T](sym: Symbol)(f: Symbol => T): List[List[T]] = mmap(sym.info.paramss)(f) + def existingSymbols(syms: List[Symbol]): List[Symbol] = + syms filter (s => (s ne null) && (s ne NoSymbol)) + /** Return closest enclosing method, unless shadowed by an enclosing class. */ // TODO Move back to ExplicitOuter when the other call site is removed. // no use of closures here in the interest of speed. |