junrushao commented on code in PR #78:
URL: https://github.com/apache/tvm-ffi/pull/78#discussion_r2409188966


##########
src/ffi/extra/structural_equal.cc:
##########
@@ -317,30 +319,34 @@ class StructEqualHandler {
     if (lhs.size() == rhs.size()) return true;
     if (mismatch_lhs_reverse_path_ != nullptr) {
       if (lhs.size() > rhs.size()) {
-        
mismatch_lhs_reverse_path_->emplace_back(reflection::AccessStep::ArrayItem(rhs.size()));
+        mismatch_lhs_reverse_path_->emplace_back(
+            
reflection::AccessStep::ArrayItem(static_cast<int64_t>(rhs.size())));
         mismatch_rhs_reverse_path_->emplace_back(
-            reflection::AccessStep::ArrayItemMissing(rhs.size()));
+            
reflection::AccessStep::ArrayItemMissing(static_cast<int64_t>(rhs.size())));
       } else {
         mismatch_lhs_reverse_path_->emplace_back(
-            reflection::AccessStep::ArrayItemMissing(lhs.size()));
-        
mismatch_rhs_reverse_path_->emplace_back(reflection::AccessStep::ArrayItem(lhs.size()));
+            
reflection::AccessStep::ArrayItemMissing(static_cast<int64_t>(lhs.size())));
+        mismatch_rhs_reverse_path_->emplace_back(
+            
reflection::AccessStep::ArrayItem(static_cast<int64_t>(lhs.size())));
       }
     }
     return false;
   }
 
+  // NOLINTNEXTLINE(performance-unnecessary-value-param)
   bool CompareShape(Shape lhs, Shape rhs) {
     if (lhs.size() != rhs.size()) {
       return false;
     }
-    for (size_t i = 0; i < lhs.size(); ++i) {
+    for (int64_t i = 0, n = static_cast<int64_t>(lhs.size()); i < n; ++i) {

Review Comment:
   It's not



##########
src/ffi/extra/structural_equal.cc:
##########
@@ -317,30 +319,34 @@ class StructEqualHandler {
     if (lhs.size() == rhs.size()) return true;
     if (mismatch_lhs_reverse_path_ != nullptr) {
       if (lhs.size() > rhs.size()) {
-        
mismatch_lhs_reverse_path_->emplace_back(reflection::AccessStep::ArrayItem(rhs.size()));
+        mismatch_lhs_reverse_path_->emplace_back(
+            
reflection::AccessStep::ArrayItem(static_cast<int64_t>(rhs.size())));
         mismatch_rhs_reverse_path_->emplace_back(
-            reflection::AccessStep::ArrayItemMissing(rhs.size()));
+            
reflection::AccessStep::ArrayItemMissing(static_cast<int64_t>(rhs.size())));
       } else {
         mismatch_lhs_reverse_path_->emplace_back(
-            reflection::AccessStep::ArrayItemMissing(lhs.size()));
-        
mismatch_rhs_reverse_path_->emplace_back(reflection::AccessStep::ArrayItem(lhs.size()));
+            
reflection::AccessStep::ArrayItemMissing(static_cast<int64_t>(lhs.size())));
+        mismatch_rhs_reverse_path_->emplace_back(
+            
reflection::AccessStep::ArrayItem(static_cast<int64_t>(lhs.size())));
       }
     }
     return false;
   }
 
+  // NOLINTNEXTLINE(performance-unnecessary-value-param)
   bool CompareShape(Shape lhs, Shape rhs) {
     if (lhs.size() != rhs.size()) {
       return false;
     }
-    for (size_t i = 0; i < lhs.size(); ++i) {
+    for (int64_t i = 0, n = static_cast<int64_t>(lhs.size()); i < n; ++i) {

Review Comment:
   It's not a necessary change. Reverting it back



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to