Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-3075

unique() algorithm is not correct in pivot.js file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.7.3
    • 0.8.0
    • front-end
    • None

    Description

      unique() algorithm is not correct in pivot.js file.

      The algo is like this:

      let unique = function (list) {
            for (let i = 0; i < list.length; i++) {
              for (let j = i + 1; j < list.length; j++) {
                if (angular.equals(list[i], list[j])) {
                  list.splice(j, 1)
                }
              }
            }
          }
      

      But it's not correct. If the input is [2, 3, 3, 3, 4, 5] and the output will be [2, 3, 3, 4, 5]. The number 3 is still duplicated.

      Attachments

        Activity

          People

            liguohui Guohui LI
            liguohui Guohui LI
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: