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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.5.1.1
    • 10.5.1.1
    • SQL
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: