aaron.ballman added inline comments.

================
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:621
 
+static bool isSameToken(const Token &T1, const Token &T2,
+                        const SourceManager &SM) {
----------------
`isSameRawIdentifierToken()` so that the name isn't too generic.


================
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:629-630
+    return false;
+  return strncmp(SM.getCharacterData(T1.getLocation()),
+                 SM.getCharacterData(T2.getLocation()), T1.getLength()) == 0;
+}
----------------
I would feel more comfortable if this were written:
```
return StringRef(SM.getCharacterData(T1.getLocation()), T1.getLength()) == 
StringRef(SM.getCharacterData(T2.getLocation()), T2.getLength());
```


================
Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:674
+  return !(
+      (isTokAtEndOfExpr(Lsr, LTok, SM) && isTokAtEndOfExpr(Rsr, RTok, SM)) &&
+      isSameToken(LTok, RTok, SM));
----------------
You can drop a set of parens here as they don't change the order of evaluation.


================
Comment at: test/clang-tidy/misc-redundant-expression.cpp:152
 
+
 // Overloaded operators that compare two instances of a struct.
----------------
Spurious newline.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55125/new/

https://reviews.llvm.org/D55125



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

Reply via email to