Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1198 Refactorings and Cleanups
  3. ZOOKEEPER-1247

dead code in PrepRequestProcessor.pRequest multi case

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.5.0
    • None
    • None
    • Reviewed

    Description

      There's an if statement in the for loop which sets the request.hdr.type and request.txn in case that an error happened in the preceding multiop. However hdr and txn are overwritten anyways at the end of the multi case. The values set are only used a bit later to serialize them. This could better be achieved with local variables holding the temporary hdr and txn.

      Also the if condition (ke == null) in the catch block is pointless, since the surrounding if(ke != null) makes sure that the catch block could only ever be reached in a loop where ke == null.

      Attachments

        1. ZOOKEEPER-1247.patch
          3 kB
          Thomas Koch

        Activity

          People

            thkoch Thomas Koch
            thkoch Thomas Koch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: