Skip to content

Commit 382f70a

Browse files
authored
[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.
1 parent 3d91d96 commit 382f70a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/string

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,8 +1948,8 @@ private:
19481948
if (__s < __min_cap) {
19491949
return static_cast<size_type>(__min_cap) - 1;
19501950
}
1951-
size_type __guess =
1952-
__align_it < sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1 > (__s + 1) - 1;
1951+
const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1;
1952+
size_type __guess = __align_it<__boundary>(__s + 1) - 1;
19531953
if (__guess == __min_cap)
19541954
++__guess;
19551955
return __guess;

0 commit comments

Comments
 (0)