[PATCH] D12355: [libcxx] Optimize away unneeded length calculation in basic_string::compare(const char*)

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 13:47:53 PDT 2015


mclow.lists added a comment.

In http://reviews.llvm.org/D12355#233477, @bkramer wrote:

> Won't this do the wrong thing for embedded '\0' in a std::string?
>
>   std::string("hello\0world", 11).compare("hello")
>   
>
> should not return 0.


Good point; I think that pretty much kills this proposed change.


http://reviews.llvm.org/D12355





More information about the cfe-commits mailing list