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

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 13:02:33 PDT 2015


bkramer added a subscriber: bkramer.
bkramer added a comment.

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.


http://reviews.llvm.org/D12355





More information about the cfe-commits mailing list