zinovy.nis added inline comments.

================
Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:71
+  // supported by specific code pages only.
+  if (Bytes.find_if_not(isASCII) != StringRef::npos)
+    return false;
----------------
aaron.ballman wrote:
> I am starting to think that this functionality should be refactored because 
> the check is now O(N^2) in the worst case because all of the bytes of the 
> string need to be touched twice. It would be nice for performance reasons to 
> combine this so that there's only a single pass over all of the characters.
> 
> What do you think?
Sorry, but why O(N^2)? `isASCII` is O(1), it's just `return C<=127`. 
`find_if_not` is O(N).


https://reviews.llvm.org/D45932



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

Reply via email to