Skip to content

Commit d22478b

Browse files
committed
Merge pull request #1929 from danra/identifier_notequals_dry2
Prettier operator!= DRY
2 parents 885d33e + 201873b commit d22478b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/swift/AST/Identifier.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Identifier {
143143
int compare(Identifier other) const;
144144

145145
bool operator==(Identifier RHS) const { return Pointer == RHS.Pointer; }
146-
bool operator!=(Identifier RHS) const { return !operator==(RHS); }
146+
bool operator!=(Identifier RHS) const { return !(*this==RHS); }
147147

148148
bool operator<(Identifier RHS) const { return Pointer < RHS.Pointer; }
149149

@@ -367,7 +367,7 @@ class DeclName {
367367
}
368368

369369
friend bool operator!=(DeclName lhs, DeclName rhs) {
370-
return !operator==(lhs, rhs);
370+
return !(lhs == rhs);
371371
}
372372

373373
friend bool operator<(DeclName lhs, DeclName rhs) {
@@ -481,7 +481,7 @@ class ObjCSelector {
481481
}
482482

483483
friend bool operator!=(ObjCSelector lhs, ObjCSelector rhs) {
484-
return !operator==(lhs, rhs);
484+
return !(lhs == rhs);
485485
}
486486

487487
friend bool operator<(ObjCSelector lhs, ObjCSelector rhs) {

0 commit comments

Comments
 (0)