stevedlawrence commented on a change in pull request #694:
URL: https://github.com/apache/daffodil/pull/694#discussion_r810307989



##########
File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ElementBase.scala
##########
@@ -693,23 +693,19 @@ trait ElementBase
 
   // FIXME: bless this method. Deprecate and remove other less reliable things.
   final lazy val maybeFixedLengthInBits: MaybeULong = {
-    if (optRepTypeElement.isDefined) {
-      optRepTypeElement.get.maybeFixedLengthInBits
-    } else {
-      if (isRepresented && isFixedLength) {
-        val bitsMultiplier = lengthUnits match {
-          case LengthUnits.Bits => 1
-          case LengthUnits.Bytes => 8
-          case LengthUnits.Characters => if (knownEncodingIsFixedWidth) 
knownEncodingWidthInBits else -1
-        }
-        if (bitsMultiplier > 0) {
-          MaybeULong(fixedLengthValue * bitsMultiplier)
-        } else {
-          MaybeULong.Nope
-        }
+    if (isRepresented && repElement.isFixedLength) {
+      val bitsMultiplier = repElement.lengthUnits match {
+        case LengthUnits.Bits => 1
+        case LengthUnits.Bytes => 8
+        case LengthUnits.Characters => if (knownEncodingIsFixedWidth) 
knownEncodingWidthInBits else -1

Review comment:
       Should this be `repElement.knownEncoding...`




-- 
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]


Reply via email to