djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
A couple of small comments, otherwise looks good.
================
Comment at: lib/Tooling/Core/Replacement.cpp:284
@@ +283,3 @@
+ std::sort(Ranges.begin(), Ranges.end(),
+ [](const Range &LHS, const Range &RHS) -> bool {
+ if (LHS.getOffset() != RHS.getOffset())
----------------
I don't think you need "-> bool".
================
Comment at: lib/Tooling/Core/Replacement.cpp:285
@@ +284,3 @@
+ [](const Range &LHS, const Range &RHS) -> bool {
+ if (LHS.getOffset() != RHS.getOffset())
+ return LHS.getOffset() < RHS.getOffset();
----------------
or std::tie(LHS.getOffset(), LHS.getLength()) < std::tie(RHS.getOffset(),
RHS.getLength())?
================
Comment at: lib/Tooling/Core/Replacement.cpp:292
@@ +291,3 @@
+ if (Result.empty() ||
+ Result.back().getOffset() + Result.back().getLength() < R.getOffset())
{
+ Result.push_back(R);
----------------
Maybe pull out:
unsigned CurrentEnd = Result.back().getOffset() + Result.back().getLength();
Will probably save a line or two :)
http://reviews.llvm.org/D21547
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits