mbeckerle commented on a change in pull request #30: Performance improvements
around FormatInfo change.
URL: https://github.com/apache/incubator-daffodil/pull/30#discussion_r163976132
##########
File path:
daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Evaluatable.scala
##########
@@ -336,30 +292,40 @@ abstract class Evaluatable[+T <: AnyRef](protected val
rd: RuntimeData, qNameArg
}
}
- private var constValue_ : Option[AnyRef] = None
- protected def constValue = constValue_.asInstanceOf[Option[T]]
+ private var constValue_ : Maybe[AnyRef] = Nope
- def optConstant = {
- ensureCompiled
- constValue
- }
+ /**
+ * Preferred for use in the runtime.
+ */
+ @inline final def maybeConstant = constValue_.asInstanceOf[Maybe[T]]
Review comment:
Seemed inconsistent with general notion that Option is used in compiler and
Maybe in the runtime. Saves 1 indirection.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services