-
Notifications
You must be signed in to change notification settings - Fork 942
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
fix bug when the number of segments is integer(line-chunk) #1046
Conversation
if numberOfSegments is an integer, like line length is 100, and segmentLength is 10, it's just 10 segments, no need to plus 1 to 11, otherwise will throw exception later.
fix bug when the number of segments is integer(line-chunk)
@xiongjiabin Why did you close this PR? this looked fine...? just needed a few linting fixes |
@xiongjiabin You should need to fix the linting issues: This should be the code: var numberOfSegments = lineLength / segmentLength;
// If numberOfSegments is integer, no need to plus 1
if (!Number.isInteger(numberOfSegments)) {
numberOfSegments = Math.floor(numberOfSegments) + 1;
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I found failed in lint, so close the PR, thanks! |
This is why we have automated testing, to catch minor issues like Linting, no need to close PR, just commit a new fix with the provided error from TravisCI. |
if numberOfSegments is an integer, like line length is 100, and segmentLength is 10, it's just 10 segments, no need to plus 1 to 11, otherwise will throw an exception later.