Skip to content

Commit

Permalink
Improve filterByHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
julian merlo authored and julian merlo committed Sep 24, 2024
1 parent 2d48888 commit 5fb70db
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class HealthyProvidersPool<
const nextMaxHeight = Math.max(...heights.filter((h) => h < maxHeight));

// Filter out the maximum height if it's significantly ahead
if (nextMaxHeight && maxHeight - nextMaxHeight > THRESHOLD) {
if (!nextMaxHeight && maxHeight - nextMaxHeight > THRESHOLD) {
providers = providerWithHeight.filter(
(item) => parseFloat(String(item.height)) < maxHeight
);
Expand Down

0 comments on commit 5fb70db

Please sign in to comment.