projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5878ac7
)
[clang-format][NFC] Reorder conditions
author
Björn Schäpers
<bjoern@hazardy.de>
Fri, 3 Dec 2021 07:45:56 +0000
(08:45 +0100)
committer
Björn Schäpers
<bjoern@hazardy.de>
Sat, 4 Dec 2021 20:29:29 +0000
(21:29 +0100)
Prefer to check the local variables first before dereferencing the
pointer.
Differential Revision: https://reviews.llvm.org/D115066
clang/lib/Format/TokenAnnotator.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Format/TokenAnnotator.cpp
b/clang/lib/Format/TokenAnnotator.cpp
index
3633c7c
..
cc6d066
100644
(file)
--- a/
clang/lib/Format/TokenAnnotator.cpp
+++ b/
clang/lib/Format/TokenAnnotator.cpp
@@
-2173,8
+2173,8
@@
public:
int CurrentPrecedence = getCurrentPrecedence();
- if (
Current && Current->is(TT_SelectorName)
&&
-
Precedence == CurrentPrecedence
) {
+ if (
Precedence == CurrentPrecedence && Current
&&
+
Current->is(TT_SelectorName)
) {
if (LatestOperator)
addFakeParenthesis(Start, prec::Level(Precedence));
Start = Current;