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

Minor cleanup of DataDictionaryImpl.getRoutineList()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.9.1.0
    • 10.9.1.0
    • SQL
    • None

    Description

      I noticed two small possibilities for improvement in DataDictionaryImpl.getRoutineList() when I worked on DERBY-5730:

      • The method always returns a list of one or zero items. Instead of creating an ArrayList, it should use Collections.singletonList() and Collections.EMPTY_LIST, which are more memory-efficient.
      • It loops through the entire SYSFUN_FUNCTIONS array, even if the matching function is found in the first cell of the array. It should break out of the loop once a match is found.

      Attachments

        1. d5755-1b.diff
          2 kB
          Knut Anders Hatlen
        2. d5755-1a.diff
          2 kB
          Knut Anders Hatlen

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: