Closed smalluban closed 1 week ago
The back-and-forth converting could be avoided, I assume, but modeling the underlying data structure:
paused = [{ id: "foo", ...rest1 }, { id: "bar", ...rest2 }, ...]
as
paused = {
foo: { ...rest1 },
bar: { ...rest2 },
...
}
But I'm also fine with keeping the array structure if it is difficult to change.
Fixes #1651
Still, I am not sure if this is better. The real question is if
Array.prototype.includes
is much slower thanSet.prototype.has
... The list has unique IDs (so no benefit here), and it must be cleared each time, as otherwise, we would need to check if the user removed the domain (and it might be then even slower).