Skip to content

Commit c13a10e

Browse files
committed
[SpaceEngine] NFC: Switch to != instead of compare on Head identifiers
Since `Head` comparison only checks for equality, all of such checks could be switched from `compare` to `!=` operator.
1 parent b8ed087 commit c13a10e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/TypeCheckSwitchStmt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ namespace {
404404
PAIRCASE (SpaceKind::Constructor, SpaceKind::Constructor): {
405405
// Optimization: If the constructor heads don't match, subspace is
406406
// impossible.
407-
if (this->Head.compare(other.Head) != 0) {
407+
if (this->Head != other.Head) {
408408
return false;
409409
}
410410

@@ -551,7 +551,7 @@ namespace {
551551
PAIRCASE (SpaceKind::Constructor, SpaceKind::Constructor): {
552552
// Optimization: If the heads don't match, the intersection of
553553
// the constructor spaces is empty.
554-
if (this->getHead().compare(other.Head) != 0) {
554+
if (this->getHead() != other.Head) {
555555
return Space();
556556
}
557557

@@ -723,7 +723,7 @@ namespace {
723723
PAIRCASE (SpaceKind::Constructor, SpaceKind::Constructor): {
724724
// Optimization: If the heads of the constructors don't match then
725725
// the two are disjoint and their difference is the first space.
726-
if (this->Head.compare(other.Head) != 0) {
726+
if (this->Head != other.Head) {
727727
return *this;
728728
}
729729

0 commit comments

Comments
 (0)