summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Symbols.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-08 12:04:27 -0700
committerPaul Phillips <paulp@improving.org>2013-06-08 12:04:27 -0700
commit45d61774eb255416c96e983cdb87960ad6415b74 (patch)
tree4aeb3debc1cf0a79ece22175f4be8450b607594b /src/reflect/scala/reflect/internal/Symbols.scala
parent04837e710552cc53b0b06b2bc47ee7d2856ae230 (diff)
downloadscala-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.scala3
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.