Skip to content

Commit

Permalink
Remove filterDuplicateTimeLogs
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Apr 13, 2024
1 parent 3aa6aca commit 691d998
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/sandbox/nodeWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const batchedUpdate = batch(() => {
parentPort.postMessage({
type: 'update',
data: {result, logs},
// data: {result, logs: filterDuplicateTimeLogs(logs)},
})
}, setTimeout)

Expand Down Expand Up @@ -74,33 +73,3 @@ function batch(fn, scheduleFn) {
return promise
}
}

/*
// FIXME: it's a bug in console-feed
{
id: '',
method: 'log',
data: [ '%s: %s', 'fn', '10.943ms' ]
},
{
id: ''
method: 'log',
data: [ 'fn: 10ms' ],
}
*/
function filterDuplicateTimeLogs(logs) {
return logs.filter((x, i) => {
const prev = logs[i - 1]
if (
prev &&
x.method === 'log' &&
prev.method === x.method &&
prev.data?.[0] === '%s: %s' &&
prev.data?.[2].endsWith('ms') &&
x.data?.[0].startsWith(prev.data[1])
) {
return false
}
return true
})
}

0 comments on commit 691d998

Please sign in to comment.