[libcxx-commits] [libcxx] [libc++] Optimize filebuf::seekoff (PR #211788)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 24 06:29:28 PDT 2026
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 origin/main HEAD --extensions ,cpp -- libcxx/include/fstream libcxx/test/benchmarks/streams/fstream.bench.cpp libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 099c025e1..4a1479624 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -1023,7 +1023,6 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
return __success_pos;
}
case ios::cur: {
-
// If the new position is within the buffer we can just move the current read pointer
if ((__cm_ & ios::in) &&
(__off < 0 ? this->gptr() - this->eback() <= __off : this->egptr() - this->gptr() >= __off)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/211788
More information about the libcxx-commits
mailing list