[PATCH] Added a naive NOLINT implementation.
    Alexander Kornienko 
    alexfh at google.com
       
    Thu Feb 27 16:37:51 PST 2014
    
    
  
================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:48
@@ +47,3 @@
+  if (!Invalid) {
+    StringRef Line(CharacterData);
+    Line = Line.substr(0, Line.find_first_of("\r\n"));
----------------
Manuel Klimek wrote:
> I'd probably prefer a combination of getOffset and getBufferData or getBuffer  instead of scanning for the 0 byte.
Changed the code to find the first of '\r', '\n' or '\0' in one pass. We need to find \r|\n anyway, so there's no need to use getOffset/getBuffer to just avoid searching for '\0'
http://llvm-reviews.chandlerc.com/D2896
COMMIT
  http://llvm-reviews.chandlerc.com/rL202452
    
    
More information about the cfe-commits
mailing list