[clang-tidy][NFC] Tweak GlobList to iterate backwards
authorNathan James <n.james93@hotmail.co.uk>
Tue, 10 Nov 2020 14:27:22 +0000 (14:27 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Tue, 10 Nov 2020 14:27:24 +0000 (14:27 +0000)
commite076fee63dd385dace3ce2036e4f64fa1b74d3f3
tree65acc088ae11f299176d328defaff52d9b1b576e
parentc50faf5c9d7ca7a62cd59516c7de305b73f2455c
[clang-tidy][NFC] Tweak GlobList to iterate backwards

By iterating backwards over the globs we can exit the loop as soon as we find a match.

While we're here:
 - Regex doesn't need to be mutable.
 - We can reserve the amount of Globs needed ahead of time.
 - Using a SmallVector with size 0 is slightly more space efficient than a std::vector.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D91033
clang-tools-extra/clang-tidy/GlobList.cpp
clang-tools-extra/clang-tidy/GlobList.h