Skip to content

Conversation

@dlmarion
Copy link
Contributor

No description provided.

@dlmarion dlmarion added this to the 1.0.0 milestone Jan 13, 2026
@dlmarion dlmarion self-assigned this Jan 13, 2026
public static CharSequence unescape(CharSequence auth) {
int escapeCharCount = 0;
for (int i = 0; i < auth.length(); i++) {
final int authLength = auth.length();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also make this change to avoid duplicate length() calls in AuthorizationValidator

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'm not seeing duplicate calls in that class, can you point me to it?

Copy link
Contributor

Choose a reason for hiding this comment

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

It only calls it once in the code, noticed the function call is repeatedly called at runtime for each loop iteration. That was what I was thinking of in terms of duplication, but not sure if its worthwhile to avoid that or not.

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'm seeing that where it is being called from an authorization is being passed in, presumably the auth token is unique. I'm not seeing a loop, can you point me to it?

Copy link
Contributor

@keith-turner keith-turner Jan 15, 2026

Choose a reason for hiding this comment

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

The following code is what I was thinking could benefit from the same changes being made elsewhere in this PR.

@dlmarion dlmarion merged commit be1b160 into apache:main Jan 15, 2026
6 checks passed
@dlmarion dlmarion deleted the remove-duplicate-method-calls branch January 15, 2026 23:10
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