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

simplify linoNo increment #284

Merged
merged 1 commit into from
Apr 24, 2016

Conversation

wojciechczerniak
Copy link
Collaborator

I had a problem with double increment until I realized the second one is just ignored.
There are three solutions to simplify the code:

  1. remove second post-increment: this.cache.lineNo = lineNo
  2. remove the first one, and use pre-increment this.cache.lineNo = ++lineNo
  3. make it so obvious that no one ever wonders why this.cache.lineNo = lineNo + 1

I like the last one best.

@rossPatton rossPatton merged commit e90993d into SimenB:develop Apr 24, 2016
@wojciechczerniak wojciechczerniak deleted the simplify-lineNo-increment branch April 24, 2016 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants