|1141 ↗||(On Diff #70842)|
Couldn't you just do:
for (auto *Tok = Left->Next; Tok && Tok != Right; Tok = Tok->Next) if (Tok->is(tok::comment)) deleteToken(Comment);
That way you wouldn't have to store the comments in a vector.
One remark, otherwise looks good.
|1136 ↗||(On Diff #70863)|
Hm. I think this "if" actually doesn't change behavior. If we remove it, we'd just add already deleted tokens to the set again, which shouldn't hurt (and we do it for comments at the moment). I'd just remove this line.