Skip to content

Commit f29fe1c

Browse files
authored
Use const reference parameters in LinearLayout operators == and != (#6828)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 94d6eb0 commit f29fe1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/triton/Tools/LinearLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ class LinearLayout {
747747

748748
std::string toString() const;
749749

750-
friend bool operator==(LinearLayout lhs, LinearLayout rhs);
751-
friend bool operator!=(LinearLayout lhs, LinearLayout rhs) {
750+
friend bool operator==(const LinearLayout &lhs, const LinearLayout &rhs);
751+
friend bool operator!=(const LinearLayout &lhs, const LinearLayout &rhs) {
752752
return !(lhs == rhs);
753753
}
754754
bool equalIgnoringOutDimSizes(const LinearLayout &other) const;

lib/Tools/LinearLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ size_t hash_value(const LinearLayout &layout) {
11301130
return seed;
11311131
}
11321132

1133-
bool operator==(LinearLayout lhs, LinearLayout rhs) {
1133+
bool operator==(const LinearLayout &lhs, const LinearLayout &rhs) {
11341134
if (!lhs.equalIgnoringOutDimSizes(rhs))
11351135
return false;
11361136

0 commit comments

Comments
 (0)