Skip to content

LoopOverCharArray in JSONStringify #9

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

Closed
agentgt opened this issue Dec 18, 2024 · 0 comments
Closed

LoopOverCharArray in JSONStringify #9

agentgt opened this issue Dec 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@agentgt
Copy link

agentgt commented Dec 18, 2024

for(char c : string.toCharArray()) {

[WARNING] JSONStringify.java:[249,2] [LoopOverCharArray] toCharArray allocates a new array, using charAt is more efficient
    (see https://errorprone.info/bugpattern/LoopOverCharArray)
  Did you mean 'for (int i = 0; i < string.length(); i++) { char c = string.charAt(i);if (c == qt) {'?
@Synt4xErr0r4 Synt4xErr0r4 added the enhancement New feature or request label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants