Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranks Comments Err #254

Closed
FengShangWuQi opened this issue Mar 22, 2019 · 1 comment
Closed

Ranks Comments Err #254

FengShangWuQi opened this issue Mar 22, 2019 · 1 comment
Labels
potential bug Bug reported, but its not verified with a test case on codesandbox or an actual test.

Comments

@FengShangWuQi
Copy link

let SEGMENT_POINTS = 4;

let SPLAT_PENALTY = 1;

let ROOT_POINTS = 1;

if (isRootSegment(segment)) score += ROOT_POINTS;

else if (isSplat(segment)) score -= SEGMENT_POINTS + SPLAT_PENALTY;

According to code, the rank should be

static > dynamic > root > splat

rather than

// static > dynamic > splat > root

image

As the picture shows.

@mtliendo mtliendo added the potential bug Bug reported, but its not verified with a test case on codesandbox or an actual test. label Sep 11, 2019
@ryanflorence
Copy link
Member

The tie breaker is index

a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index

Those two paths are a tie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Bug reported, but its not verified with a test case on codesandbox or an actual test.
Projects
None yet
Development

No branches or pull requests

3 participants