|
|
|
|
|
by yetihehe
1022 days ago
|
|
And kill browsers... ws.onmessage = function(event) {
Object.keys(cursors).forEach((id) => {
if (!positions.find((pos) => pos.id === id)) {
document.body.removeChild(cursors[id]);
delete cursors[id];
}
});
If I'm not mistaken, this has O(n^2) complexity and is executed on EACH position update. Unless it's autooptimized to not be a linear search on positions? |
|