[cfe-commits] r157359 - in /cfe/trunk: lib/Rewrite/RewriteModernObjC.cpp test/Rewriter/rewrite-modern-atautoreleasepool.mm
jahanian
fjahanian at apple.com
Thu May 24 16:02:32 PDT 2012
On May 23, 2012, at 5:45 PM, Jordy Rose wrote:
>
> On May 23, 2012, at 19:47, Fariborz Jahanian wrote:
>
>> +Stmt *RewriteModernObjC::RewriteObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S) {
>> + SourceLocation startLoc = S->getAtLoc();
>> + ReplaceText(startLoc, strlen("@autoreleasepool"), "/* @autoreleasepool */");
>> + std::string buf;
>> + buf = "{ __AtAutoreleasePool __autoreleasepool; ";
>> + ReplaceText(S->getSubStmt()->getLocStart(), 1, buf);
>
> You have a literal string copied into a std::string and then passed to ReplaceText. Why not pass it directly, as with the first replacement? Or if this is about line length, maybe use a StringRef variable instead of a std::string?
No particular reason for this. Fixed in r157436.
- Thanks, Fariborz
>
More information about the cfe-commits
mailing list