Skip to content
Snippets Groups Projects
Unverified Commit 482f97e7 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

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.
parent 6ab51458
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment