diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-05-30 20:36:42 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-06-03 16:49:46 +0100 |
commit | 482f97e79fc29ea2d61f1425b32564a668b51e1c (patch) | |
tree | 5977c1087dff551b41300b19261d7ab120efa7b4 /gcc | |
parent | 6ab5145825ca7e96fcbe3aa505d42e4ae8f81009 (diff) | |
download | gcc-482f97e79fc29ea2d61f1425b32564a668b51e1c.zip gcc-482f97e79fc29ea2d61f1425b32564a668b51e1c.tar.gz gcc-482f97e79fc29ea2d61f1425b32564a668b51e1c.tar.bz2 |
libstdc++: Optimize std::basic_string_view::starts_with
We get smaller code at all optimization levels by not creating a
temporary object, just comparing lengths first and then using
traits_type::compare. This does less work than calling substr then
operator==.
libstdc++-v3/ChangeLog:
* include/std/string_view (starts_with(basic_string_view)):
Compare lengths first and then call traits_type::compare
directly.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions