@galacean/engine-core 0.0.0-experimental-renderSort.0 → 0.0.0-experimental-renderSort.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -21866,7 +21866,7 @@ var passNum = 0;
21866
21866
  */ _proto._quickSort = function _quickSort(a, from, to, compareFunc) {
21867
21867
  while(true){
21868
21868
  // Insertion sort is faster for short arrays.
21869
- if (to - from <= 10) {
21869
+ if (to - from <= 10000000) {
21870
21870
  this._insertionSort(a, from, to, compareFunc);
21871
21871
  return;
21872
21872
  }
@@ -21875,45 +21875,38 @@ var passNum = 0;
21875
21875
  var v0 = a[from];
21876
21876
  var v1 = a[to - 1];
21877
21877
  var v2 = a[third_index];
21878
- var swapFlag = false;
21879
21878
  var c01 = compareFunc(v0, v1);
21880
21879
  if (c01 > 0) {
21881
21880
  // v1 < v0, so swap them.
21882
21881
  var tmp = v0;
21883
21882
  v0 = v1;
21884
21883
  v1 = tmp;
21885
- swapFlag = true;
21886
21884
  } // v0 <= v1.
21887
21885
  var c02 = compareFunc(v0, v2);
21888
- if (c02 > 0) {
21889
- // v2 < v0.
21886
+ if (c02 >= 0) {
21887
+ // v2 <= v0 <= v1.
21890
21888
  var tmp1 = v0;
21891
21889
  v0 = v2;
21892
21890
  v2 = v1;
21893
21891
  v1 = tmp1;
21894
- swapFlag = true;
21895
21892
  } else {
21896
- // v2 >= v0
21893
+ // v0 <= v1 && v0 < v2
21897
21894
  var c12 = compareFunc(v1, v2);
21898
21895
  if (c12 > 0) {
21899
21896
  // v0 <= v2 < v1
21900
21897
  var tmp2 = v1;
21901
21898
  v1 = v2;
21902
21899
  v2 = tmp2;
21903
- swapFlag = true;
21904
21900
  }
21905
21901
  }
21906
21902
  // v0 <= v1 <= v2
21903
+ a[from] = v0;
21904
+ a[to - 1] = v2;
21905
+ var pivot = v1;
21907
21906
  var low_end = from + 1; // Upper bound of elements lower than pivot.
21908
21907
  var high_start = to - 1; // Lower bound of elements greater than pivot.
21909
- var pivot = v2;
21910
- if (swapFlag) {
21911
- a[from] = v0;
21912
- a[to - 1] = v2;
21913
- pivot = v1;
21914
- a[third_index] = a[low_end];
21915
- a[low_end] = pivot;
21916
- }
21908
+ a[third_index] = a[low_end];
21909
+ a[low_end] = pivot;
21917
21910
  // From low_end to i are elements equal to pivot.
21918
21911
  // From i to high_start are elements that haven't been compared yet.
21919
21912
  partition: for(var i = low_end + 1; i < high_start; i++){