[Bug libstdc++/62187] std::string==const char* could compare sizes first
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 24 14:54:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62187
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If I understand correctly, that would require doing two passes over the const
char* argument, one to find its length and another (when the lengths are equal)
to compare each character. That would be beneficial sometimes, and not other
times.
More information about the Gcc-bugs
mailing list