diff --git a/.clang-tidy b/.clang-tidy index 079170f1bf6e..632b91244789 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -52,6 +52,7 @@ modernize-*, -modernize-use-nodiscard, performance-*, readability-container-size-empty, +readability-string-compare, ' HeaderFilterRegex: '^(aten/|c10/|torch/).*$' AnalyzeTemporaryDtors: false diff --git a/torch/csrc/distributed/c10d/ProcessGroupWrapper.cpp b/torch/csrc/distributed/c10d/ProcessGroupWrapper.cpp index c27b7ce2b5a1..45f5135af6da 100644 --- a/torch/csrc/distributed/c10d/ProcessGroupWrapper.cpp +++ b/torch/csrc/distributed/c10d/ProcessGroupWrapper.cpp @@ -243,7 +243,7 @@ struct CollectiveFingerPrint { // Check op type auto other_op = opTypeToString(other.op_type_); auto this_op = opTypeToString(op_type_); - if (other_op.compare(this_op) != 0) { + if (other_op != this_op) { found_diff = true; ss << c10::str(" Op type: ", this_op, "vs ", other_op); } @@ -258,7 +258,7 @@ struct CollectiveFingerPrint { return; } for (size_t i = 0; i < other.size(); ++i) { - if (other[i].compare(curr[i]) != 0) { + if (other[i] != curr[i]) { found_diff = true; ss << c10::str(" Tensor ", arg, ": ", curr, "vs ", other); return;