|
@@ -33,6 +33,7 @@ const DataObjectList = function (name) {
|
|
|
this.isSorted = false;
|
|
|
this.preSort = [];
|
|
|
this.comparisonBasis = null;
|
|
|
+ this.isSorting = false;
|
|
|
|
|
|
* sorting
|
|
|
* @param comparator (a,b) =====> a - b
|
|
@@ -44,7 +45,12 @@ const DataObjectList = function (name) {
|
|
|
for (let i = 0; i < this.list.length; i++) {
|
|
|
this.preSort.push(this.list[i]);
|
|
|
}
|
|
|
+ if(this.isSorting){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.isSorting = true;
|
|
|
this.quickSort(this.preSort, 0, this.preSort.length - 1, this.comparisonBasis, this);
|
|
|
+ this.isSorting = false;
|
|
|
};
|
|
|
|
|
|
this.clearData = function () {
|