[libcxx-commits] [libcxx] [libc++] Optimize std::getline (PR #121346)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 5 07:17:33 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 8cb3d7b41869ab517624d8966aac200c84145daf 310f910e763d18d8fa939a8f588d00d8839ece7d --extensions ,cpp,h -- libcxx/test/benchmarks/streams/getline.bench.cpp libcxx/test/support/stream_types.h libcxx/include/istream libcxx/include/streambuf libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/istream b/libcxx/include/istream
index a9fd81d347..ea88fea2b6 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -1281,9 +1281,9 @@ getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _All
_CharT __1buf;
if (__first == __last) {
- __1buf = __next;
+ __1buf = __next;
__first = &__1buf;
- __last = &__1buf + 1;
+ __last = &__1buf + 1;
}
auto __bump_stream = [&](ptrdiff_t __diff) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/121346
More information about the libcxx-commits
mailing list