[llvm] [ADT, Support] Use std::min and std::max (NFC) (PR #164145)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 19 06:31:53 PDT 2025


================
@@ -236,8 +236,7 @@ class FormattedBytes {
       : Bytes(B), FirstByteOffset(O), IndentLevel(IL), NumPerLine(NPL),
         ByteGroupSize(BGS), Upper(U), ASCII(A) {
 
-    if (ByteGroupSize > NumPerLine)
-      ByteGroupSize = NumPerLine;
+    ByteGroupSize = std::min<uint32_t>(ByteGroupSize, NumPerLine);
----------------
kuhar wrote:

IIRC, the best practice is to cast arguments instead of specifying template arguments (since I'm not sure if the exact number and order of template arguments is guaranteed to stay the same in the future versions of C++).

https://github.com/llvm/llvm-project/pull/164145


More information about the llvm-commits mailing list