olabusayoT commented on code in PR #1337:
URL: https://github.com/apache/daffodil/pull/1337#discussion_r1819499937
##########
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/unparsers/runtime1/BinaryNumberUnparsers.scala:
##########
@@ -56,12 +58,8 @@ abstract class BinaryNumberBaseUnparser(override val
context: ElementRuntimeData
val nBits = getBitLength(state)
val value = getNumberToPut(state)
val dos = state.dataOutputStream
- val res =
- if (nBits > 0) {
- putNumber(dos, value, nBits, state)
- } else {
- true
- }
+ val res = putNumber(dos, value, nBits, state)
Review Comment:
Hmm, currently for unsigned ints, the minWidth check is the nBits == 0
check, so I think moving it out to the unparse would increase duplication since
the UE uses the same outOfRangeFmtStr that the SDW uses, reducing duplication.
--
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]