mbeckerle commented on a change in pull request #30: Performance improvements
around FormatInfo change.
URL: https://github.com/apache/incubator-daffodil/pull/30#discussion_r163701452
##########
File path:
daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/EvByteOrder.scala
##########
@@ -94,14 +93,12 @@ class CheckBitOrderAndCharsetEv(t: TermRuntimeData,
bitOrder: BitOrder, charsetE
override final protected def compute(state: ParseOrUnparseState): Ok = {
val dfdlCS = charsetEv.evaluate(state)
- dfdlCS.charset match {
- case nbsc: NonByteSizeCharset =>
- if (nbsc.requiredBitOrder !=:= bitOrder) {
- t.schemaDefinitionError("Encoding '%s' requires bit order '%s', but
bit order was '%s'.", dfdlCS.charsetName, nbsc.requiredBitOrder, bitOrder)
- }
- case _ => // do nothing
+ //
+ // If the encoding is byte aligned then bit order doesn't matter
+ // but otherwise it does.
+ if (dfdlCS.charset.mandatoryBitAlignment != 8 &&
(dfdlCS.charset.requiredBitOrder !=:= bitOrder)) {
Review comment:
Can also check if bitOrder1b % 8 == 1. If so then we're on a byte boundary
so we don't have to check further. As written I think this can cause runtime
SDEs even if the position is byte aligned.
----------------------------------------------------------------
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