- use "empty()" instead of "size()"
- refactor the re-export code so it doesn't create a new vector every time.
Details
- Reviewers
int3 - Group Reviewers
Restricted Project - Commits
- rGffc65824f0ee: [lld-macho][nfc] Minor refactoring + clang-tidy fixes
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I actually snuck in a clang-format cleanup yesterday :) https://github.com/llvm/llvm-project/commit/174deb0539ee4af7d20bfead9f73055782e878e3 (so just update the commit title I guess)
lld/MachO/Driver.cpp | ||
---|---|---|
1064–1067 |
|
lld/MachO/Driver.cpp | ||
---|---|---|
1064–1067 |
well, I'm wrong: https://godbolt.org/z/szKbeojrd |
These are clang-tidy's suggested fixes (the size() vs empty()) - not clang-format :)
lld/MachO/Driver.cpp | ||
---|---|---|
1064–1067 |
Probably because it can't know what foo does with the reference - hoisting it out could change the logic entirely: void foo(const std::vector<int>& v) { static auto* last_vector = &v; static bool first = true; if (first) first = false; else assert (&v != last_vector); } |
lld/MachO/Driver.cpp | ||
---|---|---|
359–362 | Done - sync'ing to head removed this change. |
ahh well this was one of the formatting changes I committed yesterday, hence the tidy/format confusion 😅