[libcxx-commits] [libcxx] [libc++][NFC] Rewrite function call on two lines for clarity (PR #79141)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 24 06:28:32 PST 2024


================
@@ -1948,8 +1948,8 @@ private:
     if (__s < __min_cap) {
       return static_cast<size_type>(__min_cap) - 1;
     }
-    size_type __guess =
-        __align_it < sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1 > (__s + 1) - 1;
+    const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1;
----------------
ldionne wrote:

I agree it's annoying to use `const` when we mean `constexpr`. I'm not certain about moving to the enumerator since this feels more like a temporary variable (an implementation detail) of the function, whereas the alignment is a more visible "configurable knob". Also, I'm tempted to merge as-is to avoid merge conflicts with your other patch that touches the eumerator :-).

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


More information about the libcxx-commits mailing list