stillflow.engine 0.4.7 → 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.
|
@@ -97,8 +97,6 @@ const generators = {
|
|
|
97
97
|
code += `const items = ${selectIndex}(context);`;
|
|
98
98
|
code += `const target = sf_node_cache[${container}];`;
|
|
99
99
|
code += `const { clears, addes, swaps, removes, updates } = items.flush();`;
|
|
100
|
-
code += `}`;
|
|
101
|
-
code += `else {`;
|
|
102
100
|
code += `if (clears) {`;
|
|
103
101
|
code += `const freelist = ${elementsIndex}.splice(0);`;
|
|
104
102
|
code += `for (const element of freelist) {`;
|
|
@@ -122,10 +120,11 @@ const generators = {
|
|
|
122
120
|
code += `target.appendChild(fragment);`;
|
|
123
121
|
code += `}`;
|
|
124
122
|
code += `for (const [i, j] of swaps.entries()) {`;
|
|
125
|
-
code += `
|
|
126
|
-
code += `
|
|
127
|
-
code += `
|
|
128
|
-
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;`;
|
|
129
128
|
code += `}`;
|
|
130
129
|
code += `for (const id of removes) {`;
|
|
131
130
|
code += `const element = ${elementsIndex}[id];`;
|
|
@@ -136,7 +135,6 @@ const generators = {
|
|
|
136
135
|
code += `${applierIndex}(${elementsIndex}[id], items.at(id));`;
|
|
137
136
|
code += `}`;
|
|
138
137
|
code += `}`;
|
|
139
|
-
code += `}`;
|
|
140
138
|
return code;
|
|
141
139
|
}
|
|
142
140
|
};
|
|
@@ -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
|
}
|