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

[Internal][Cleanup] Garbage collect unused bit-flag org.eclipse.jdt.internal.compiler.codegen.BranchLabel.USED #3407

Closed
srikanth-sankaran opened this issue Dec 6, 2024 · 0 comments · Fixed by #3408
Assignees
Milestone

Comments

@srikanth-sankaran
Copy link
Contributor

Found by code inspection:

The bit-flag org.eclipse.jdt.internal.compiler.codegen.BranchLabel.USED is not useful. We religiously set it on branch labels and case labels, but the only use of it from org.eclipse.jdt.internal.compiler.codegen.CaseLabel.place() reads:

        if ((this.tagBits & USED) != 0) {
		this.position = this.codeStream.getPosition();
	} else {
		this.position = this.codeStream.position;
	}

Now, there is a single implementation of the method getPosition() in the CodeStream hierarchy that simply returns this.position

So the block above is effectively pointless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant