stillflow.engine 0.4.8 → 0.4.9
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.
|
@@ -120,10 +120,11 @@ const generators = {
|
|
|
120
120
|
code += `target.appendChild(fragment);`;
|
|
121
121
|
code += `}`;
|
|
122
122
|
code += `for (const [i, j] of swaps.entries()) {`;
|
|
123
|
-
code += `
|
|
124
|
-
code += `
|
|
125
|
-
code += `
|
|
126
|
-
code +=
|
|
123
|
+
code += `target.insertBefore(${elementsIndex}[i], ${elementsIndex}[j + 1]);`;
|
|
124
|
+
code += `target.insertBefore(${elementsIndex}[j], ${elementsIndex}[i + 1]);`;
|
|
125
|
+
code += `const temporary = ${elementsIndex}[i];`;
|
|
126
|
+
code += `${elementsIndex}[i] = ${elementsIndex}[j];`;
|
|
127
|
+
code += `${elementsIndex}[j] = temporary;`;
|
|
127
128
|
code += `}`;
|
|
128
129
|
code += `for (const id of removes) {`;
|
|
129
130
|
code += `const element = ${elementsIndex}[id];`;
|
|
@@ -81,11 +81,8 @@ class BenchmarkApplicationController {
|
|
|
81
81
|
}
|
|
82
82
|
swap() {
|
|
83
83
|
const size = this._view.items.size;
|
|
84
|
-
const mutator = (id) => (view) => view.index = id;
|
|
85
84
|
if (size > 998) {
|
|
86
85
|
this._view.items.swap(1, 998);
|
|
87
|
-
this._view.items.mutate(1, mutator(1));
|
|
88
|
-
this._view.items.mutate(998, mutator(998));
|
|
89
86
|
this._stillflow.commit();
|
|
90
87
|
}
|
|
91
88
|
}
|