aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/util/common.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-28 14:24:11 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-28 14:41:21 +0100
commit76f07f7a5e03ac685270c7af4aa736ca84a00f1f (patch)
tree7f59a4ed0d26792070c3d0b1e9c3f257e4b023e3 /src/dotty/tools/dotc/util/common.scala
parentc39c2af036e9e69fc339b805a0869126efadae0f (diff)
downloaddotty-76f07f7a5e03ac685270c7af4aa736ca84a00f1f.tar.gz
dotty-76f07f7a5e03ac685270c7af4aa736ca84a00f1f.tar.bz2
dotty-76f07f7a5e03ac685270c7af4aa736ca84a00f1f.zip
Hoisting out commonly used values into util.common
... because this cuts down on object creations. Also, some polishings in Denotations.
Diffstat (limited to 'src/dotty/tools/dotc/util/common.scala')
-rw-r--r--src/dotty/tools/dotc/util/common.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/util/common.scala b/src/dotty/tools/dotc/util/common.scala
new file mode 100644
index 000000000..5f133b079
--- /dev/null
+++ b/src/dotty/tools/dotc/util/common.scala
@@ -0,0 +1,16 @@
+package dotty.tools.dotc
+package util
+
+import core.Names.Name
+import core.Types.WildcardType
+
+/** Common values hoisted out for performance */
+object common {
+
+ val emptyDNF = (Nil, Set[Name]()) :: Nil
+
+ val alwaysTrue = Function.const(true) _
+ val alwaysZero = Function.const(0) _
+ val alwaysWildcardType = Function.const(WildcardType) _
+
+} \ No newline at end of file