Skip to content
Snippets Groups Projects
Commit e9df1ec3 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Use string equality operator for comparison.

From llvm documentation https://clang.llvm.org/extra/clang-tidy/checks/misc-string-compare.html
"A common mistake is to use the string’s compare method instead of using the equality or inequality operators. The compare method is intended for sorting functions and thus returns a negative number, a positive number or zero depending on the lexicographical relationship between the strings compared. If an equality or inequality check can suffice, that is recommended. This is recommended to avoid the risk of incorrect interpretation of the return value and to simplify the code. The string equality and inequality operators can also be faster than the compare method due to early termination."
parent fb6e0bcb
No related branches found
No related tags found
Loading
Showing
with 89 additions and 78 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment