Reduced the amount of wrong conversions of this check.
Details
Diff Detail
Event Timeline
Nice!
clang-tidy/modernize/LoopConvertCheck.cpp | ||
---|---|---|
378 | (not necessarily in this CL) please rename E to Expression or similar; I'm fine with one-letter variables for small scopes, but struct scopes are basically infinite. | |
test/clang-tidy/modernize-loop-convert-basic.cpp | ||
437 | Use LLVM coding conventions for iterators (I, E) as above. | |
448 | This test seems to be missing the it.insert(0) case that was removed from the "unsupported" comment, if I'm not missing something. | |
540–541 | Isn't it important that it's a pointer to an unsigned const, not that the iterator method is const? |
test/clang-tidy/modernize-loop-convert-basic.cpp | ||
---|---|---|
448 | It was in the test 'modernize-loop-convert-negative.cpp'. I moved these ones there as well. | |
540–541 | The important thing is that the check now adds a "const" whenever it is safe to do it. I changed the return type to a pointer just to be more consistent with what an iterator is supposed to be. It isn't important at all in this case. |
Learned that I need to learn to read, because the deleted comment was just duplicated.
Looks good, great first step towards making this significantly more useful :)
(not necessarily in this CL) please rename E to Expression or similar; I'm fine with one-letter variables for small scopes, but struct scopes are basically infinite.