hwright added inline comments.

================
Comment at: test/clang-tidy/abseil-duration-unnecessary-conversion.cpp:48
 
+  d2 = absl::Hours(d1 / absl::Hours(1));
+  // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration 
conversions [abseil-duration-unnecessary-conversion]
----------------
hokein wrote:
> An off-topic comment: do we have this code pattern in the codebase? From my 
> understanding, the usage like this is really rare. 
This mostly shows up in migrations.  When an existing API takes an integer, and 
caller already has a `Duration`, they sometimes use `dur / absl::Seconds(1)` to 
get back in integer at the callsite.   After a migration, we end up with 
`absl::Seconds(dur /absl::Seconds(1))`, which should really just be `dur`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59183/new/

https://reviews.llvm.org/D59183



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to