Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1394

AlignmentFillParser not being optimized out in obvious case.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Normal Normal
    • 2.0.0
    • 2.0.0
    • Middle "End"
    • None

    Description

      There are places where a format is all text, in a ordinary byte encoding like ascii or utf-8, yet alignmentFillParser is still inserted.

      The optimization depends on this logic, which is not correct, as it never actually looks to see if something is of byte length at all.

      final override lazy val isKnownToBePrecededByAllByteLengthItems: Boolean = {
          val es = nearestEnclosingSequence
          es match {
            case None => true
            case Some(s) => {
              if (s.groupMembers.head eq this) s.isKnownToBePrecededByAllByteLengthItems
              else {
                //pass for now
                val index = s.groupMembers.indexOf(this)
                s.groupMembers.slice(0, index).forall { _.isKnownToBePrecededByAllByteLengthItems }
              }
            }
          }
        }

      Gliffy Diagrams

        Attachments

          Activity

            People

              dthompson David Thompson
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Tasks