Derby
  1. Derby
  2. DERBY-5293

Replace bubble sort in DataDictionaryImpl and CreateTriggerNode with Collections.sort()

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      DataDictionaryImpl and CreateTriggerNode contain implementations of bubble sort that could be replaced by calls to Collections.sort(). This isn't performance critical code (it's only used for sorting vectors of column references or table nodes at compile time) so there shouldn't be much to gain by hand-coding the sorting. Using Collections.sort() has the benefits that it results in less code and that the implementation has probably gone through more testing than our hand-coded one.

      1. d5293.diff
        7 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1141005.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1141005.
        Hide
        Knut Anders Hatlen added a comment -

        Attaching patch that removes the manual sorting and uses Collections.sort() instead.

        All the regression tests ran cleanly with the patch.

        Show
        Knut Anders Hatlen added a comment - Attaching patch that removes the manual sorting and uses Collections.sort() instead. All the regression tests ran cleanly with the patch.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development