malcolm.parsons added inline comments.

================
Comment at: docs/clang-tidy/checks/misc-string-compare.rst:12
+zero depending on the lexicographical relationship between the strings 
compared. 
+If an equality or inequality check can suffice, that is recommended.
+
----------------
alexfh wrote:
> The documentation doesn't explain why is using `compare` for equality 
> comparison should be avoided. Maybe `that is recommended to avoid the risk of 
> incorrect interpretation of the return value and simplify the code`?
Also, a string equality check can be faster than compare as it can exit early 
when the strings aren't the same length.


https://reviews.llvm.org/D27210



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to