pkatlic commented on code in PR #1137:
URL: https://github.com/apache/daffodil/pull/1137#discussion_r1462391574
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dpath/Expression.scala:
##########
@@ -969,16 +989,27 @@ sealed abstract class StepExpression(val step: String,
val pred: Option[Predicat
}
final lazy val isArray: Boolean = {
- val (arrays, scalars) = stepElements.partition { _.isArray }
- (arrays.length, scalars.length) match {
+ checkAmbiguousPath
+ stepElements.exists(_.isArray)
+ }
+
+ final lazy val isOptional: Boolean = {
+ checkAmbiguousPath
+ stepElements.exists(_.isOptional)
+ }
Review Comment:
The isOptional function is now renamed to isArrayOrOptional to be clearer
about its purpose. The isArray function remains separate since it is used in
other locations requiring only arrays and not optionals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]