aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-01-24 09:28:58 -0500
committerllvmbot <60944935+llvmbot@users.noreply.github.com>2024-06-15 10:21:32 -0700
commit72c9425a79fda8e9001fcde091e8703f9fb2a43a (patch)
tree7839eaf9df01aa826f6b97497d486fbbd63fd6a2
parent443e23eed24d9533566f189ef25154263756a36d (diff)
downloadllvm-72c9425a79fda8e9001fcde091e8703f9fb2a43a.zip
llvm-72c9425a79fda8e9001fcde091e8703f9fb2a43a.tar.gz
llvm-72c9425a79fda8e9001fcde091e8703f9fb2a43a.tar.bz2
[libc++][NFC] Rewrite function call on two lines for clarity (#79141)
Previously, there was a ternary conditional with a less-than comparison appearing inside a template argument, which was really confusing because of the <...> of the function template. This patch rewrites the same statement on two lines for clarity. (cherry picked from commit 382f70a877f00ab71f3cb5ba461b52e1b59cd292)
-rw-r--r--libcxx/include/string4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/string b/libcxx/include/string
index ba169c3..618ceb7 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1943,8 +1943,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;
+ size_type __guess = __align_it<__boundary>(__s + 1) - 1;
if (__guess == __min_cap)
++__guess;
return __guess;