Skip to content

Commit 763f99a

Browse files
committed
satisfy constraint for keyed behavior
1 parent cd6e8e9 commit 763f99a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

frameworks/keyed/s2/src/bench.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ var id = 0
7575
function create (label, number) {
7676
return function () {
7777
bench(label, function () {
78+
// Technical note: the keyed behavior for array replacement can be forced
79+
// by resetting it first. Removing this would default to non-keyed behavior.
80+
//
81+
// This *could* be the default behavior in the library itself, but would be
82+
// a de-optimization for the common use case of replacing an array with another.
83+
// Even if the default behavior was keyed, non-keyed could still be forced by
84+
// mutating objects in the array.
85+
proxy.rows = null
86+
7887
proxy.rows = buildData(number)
7988
})
8089
}

0 commit comments

Comments
 (0)