Skip to content

Conversation

@Pankraz76
Copy link
Contributor

Copy link
Contributor Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

questionnaire.


/** Returns the "canonical" form for this particular result (only possible if isResolvable). */
public String canonical() {
// @formatter:off
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know it looks intended and i know you mentioned it recently, having done this (IDE) suggedtion already.

Can we evlevate this or do we need this form explizicly, then we could suppress these rare cases. Some of this pattern makes sense on some of the parts done.

@Pankraz76 Pankraz76 marked this pull request as ready for review October 24, 2025 08:37
@Pankraz76 Pankraz76 force-pushed the UnnecessaryDefaultInEnumSwitch branch from 1751960 to 2b70427 Compare October 24, 2025 08:38
@Pankraz76 Pankraz76 force-pushed the UnnecessaryDefaultInEnumSwitch branch from 2b70427 to 0914367 Compare October 24, 2025 09:51
Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, I didn't know java had exhaustiveness checks now. I have only one minor nit.

if (state.type == SPACE) {
builder.append(" ".repeat(numSpaces));
} else if (state.type == TAB) {
builder.append("\t".repeat(Math.max(0, numSpaces / state.numSpacesPerTab)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a need for the Math.max(0) part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thats off topic, as an ide suggestion:

Can be replaced with 'String.repeat()'

If we can replace a whole loop, with one single line of code its a good win reducing the overhead to a minimum:

image

Can we merge under this ciscumsstances, or should we undo?

@Pankraz76 Pankraz76 requested a review from nedtwigg October 28, 2025 07:19
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