EricWF marked an inline comment as done.

================
Comment at: include/string:3802
@@ -3799,2 +3801,3 @@
+    return _Traits::compare(__rhs.data(), __lhs, _VSTD::min(__lhs_len, 
__rhs.size())) == 0;
 }
 
----------------
mclow.lists wrote:
> Also, you should not call `traits::compare` here. You should call 
> `__rhs.compare(0, npos, __lhs, __lhs_len)`
> 
> which is what `__rhs.compare(__lhs)` does.
> 
I actually don't want to invoke `compare` because it has different semantics 
and does unneeded work. `compare` first does a comparison using  
`traits::compare` and then does a comparison using `length`. We have already 
compared based on length and we don't need to do any of the extra work that 
`compare(...)` does. I think calling `__rhs.compare(0, npos, __lhs, __lhs_len)` 
would be a pessimization.


http://reviews.llvm.org/D12355



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to