Skip to content

Commit 063d059

Browse files
italojsRafaelGSS
authored andcommitted
worker: comparing sortKey with aggregated[k] instead k. Issue #16
1 parent 5cc0bd1 commit 063d059

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function findMedian(aggregated) {
108108
// Select median
109109
const sortKey = aggregated.sortKey
110110
for (const k of Object.keys(aggregated)) {
111-
if (k === sortKey) continue
111+
if (aggregated[k] === sortKey) continue
112112
aggregated[k].sort((a, b) => a[sortKey] > b[sortKey])
113113
const middleIndex = Math.floor(aggregated[k].length / 2);
114114
results.push({

0 commit comments

Comments
 (0)