Skip to content

Commit

Permalink
[libc++][NFC] Rewrite function call on two lines for clarity (#79141)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ldionne authored Jan 24, 2024
1 parent 3d91d96 commit 382f70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcxx/include/string
Original file line number Diff line number Diff line change
Expand Up @@ -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;
size_type __guess = __align_it<__boundary>(__s + 1) - 1;
if (__guess == __min_cap)
++__guess;
return __guess;
Expand Down

0 comments on commit 382f70a

Please sign in to comment.