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

    • Type: Sub-task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

            • Assignee:
              thkoch Thomas Koch
              Reporter:
              thkoch Thomas Koch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: