Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3798

Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 10.5.1.1
    • Fix Version/s: 10.5.1.1
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Newcomer

      Description

      I came across this piece of code in TableScanResultSet.getNextRowCore():

      if (past2FutureTbl.get(rowLoc) != null)

      { past2FutureTbl.remove(rowLoc); continue; }

      I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:

      if (past2FutureTbl.remove(rowLoc) != null)

      { continue; }

        Attachments

        1. derby-3798-1.patch
          0.9 kB
          Junjie Peng
        2. derby-3798-1.stat
          0.1 kB
          Junjie Peng

          Activity

            People

            • Assignee:
              thinkallday Junjie Peng
              Reporter:
              knutanders Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: