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

Use tokens.equals() instead of tokens[] == #3439

Conversation

hugopeixoto
Copy link
Contributor

Summary

I noticed that there are still some instances of tokens[1] == "blerp" that could be replaced with tokens.equals(1, "blerp"),
and some instances of tokens[1] == othertokens[2] that could be tokens.equals(1, othertokens, 2).

This change prevents additional strings from being allocated.

First mentioned here: #2697 (comment)

I did make run and checked that things worked, but I can't tell which part these affect so I'd appreciate a closer look into the change to see if I missed something.

Checklist

  • Code is properly formatted
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

This prevents additional strings from being allocated.

Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: I84b1e5cf4d11bf8512febe068b3097770b63dc5c
Copy link
Contributor

@vmiklos vmiklos left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks. :-) a7d3efd tried to do this, but for some reason didn't catch all cases.

@vmiklos vmiklos merged commit b2abb5e into CollaboraOnline:master Oct 21, 2021
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