Skip to content

Commit

Permalink
fix zo build sorting (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
frzyc authored Jan 25, 2025
1 parent 3d446c7 commit 5598e99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions libs/sr/solver/src/parentWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,10 @@ async function start({
})
)

// Trigger spinner on UI
if (results.length > MAX_BUILDS) {
results.sort((a, b) => b.value - a.value)
results = results.slice(0, MAX_BUILDS)
}
// Send back results, which can take a few seconds
postMessage({
resultType: 'done',
buildResults: results,
buildResults: results.sort((a, b) => b.value - a.value).slice(0, 10), // TODO: take numBuilds from opt UI
})
}

Expand Down
7 changes: 1 addition & 6 deletions libs/zzz/solver/src/parentWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,10 @@ async function start({
})
)

// Trigger spinner on UI
if (results.length > MAX_BUILDS) {
results.sort((a, b) => b.value - a.value)
results = results.slice(0, MAX_BUILDS)
}
// Send back results, which can take a few seconds
postMessage({
resultType: 'done',
buildResults: results.slice(0, 10), // TODO: take numBuilds from opt UI
buildResults: results.sort((a, b) => b.value - a.value).slice(0, 10), // TODO: take numBuilds from opt UI
})
}

Expand Down

0 comments on commit 5598e99

Please sign in to comment.