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

String#replace(char, char) suggestion #2991

Open
ash211 opened this issue Jan 11, 2025 · 0 comments
Open

String#replace(char, char) suggestion #2991

ash211 opened this issue Jan 11, 2025 · 0 comments

Comments

@ash211
Copy link
Contributor

ash211 commented Jan 11, 2025

What happened?

If String#replace(String,String) is ever called with two Strings each of length 1, then this can be replaced with the String#replace(char, char) overload that is a bit more efficient. Similarly replaceAll(String,String) takes a regex for the first String, and for simple single-char matching regexes like .replaceAll("/", ".") this can be rewritten as replace('/', '.')

What did you want to happen?

I'd like to get an auto-apply suggestion from gradle-baseline for changes like this.

See Palantir-internal gradle-plugins/conjure-backcompat/pull/1712

cc @schlosna

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

No branches or pull requests

1 participant