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

"request.getHdr() != null" and "isQuorum" are identical

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      FinalRequestProcessor has this code block:

                  if (request.getHdr() != null) {
                     ... SNIP ...
                  }
                  // do not add non quorum packets to the queue.
                  if (request.isQuorum()) {
                      zks.getZKDatabase().addCommittedProposal(request);
                  }
      

      Both conditions are equivalent so the two if blocks could actually be merged to one block.

      Attachments

        1. ZOOKEEPER-1266.patch
          0.8 kB
          Thomas Koch

        Activity

          People

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

            Dates

              Created:
              Updated: