-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Interval: make public fields final
#4903
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
base: dev
Are you sure you want to change the base?
Conversation
The class docs already state that Interval is immutable, but this is not enforced. Followup to antlr#4901 Signed-off-by: Steven Schlansker <[email protected]>
63f2a79 to
3670527
Compare
| } | ||
| // if in middle a..x..b, split interval | ||
| if ( el>a && el<b ) { // found in this interval | ||
| int oldb = I.b; |
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 think this variable oldb is redundant since we already saved I.b above at line 656. Let me know if you'd like me to remove this. (I didn't, in the spirit of keeping the change minimal)
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.
Only test coverage would tell us that. Let's not touch this.
| } | ||
| // if in middle a..x..b, split interval | ||
| if ( el>a && el<b ) { // found in this interval | ||
| int oldb = I.b; |
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.
Only test coverage would tell us that. Let's not touch this.
|
@parrt blessed. |
The class docs already state that Interval is immutable, but this is not enforced.
Followup to #4901
I tried to fix up existing sites where this supposedly immutable class is mutated, to instead replace with a new value.