Details
- Reviewers
abrachet
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I encounter this issue when running the LLVM test suite with the address sanitizer enabled.
| llvm/tools/llvm-mt/llvm-mt.cpp | ||
|---|---|---|
| 153–156 | That should work too. WDYT? | |
| llvm/tools/llvm-mt/llvm-mt.cpp | ||
|---|---|---|
| 153–156 | I didn't know about that overload. I'll change it use your version. | |
In fact, bring back the size comparison to speed up the comparison in the case the sizes do not match
| llvm/tools/llvm-mt/llvm-mt.cpp | ||
|---|---|---|
| 153–156 | Ah, sorry I didn't mean to keep SameSize in my suggested change. Just this should be sufficient Same = std::equal(OutputBuffer->getBufferStart(),
OutputBuffer->getBufferEnd(),
FileBuffer->getBufferStart());
FileBuffer->getBufferStart(),
FileBuffer->getBufferEnd()); | |
| llvm/tools/llvm-mt/llvm-mt.cpp | ||
|---|---|---|
| 153–156 | I know, but checking the size first gives a shortcut in case the sizes are different (instead of scanning for a difference). Do you think we can keep it in this case ? | |
| llvm/tools/llvm-mt/llvm-mt.cpp | ||
|---|---|---|
| 153–156 | I just realized that with the right iterator type, std::equals computes the distance and does the shortcut on its own. I'm removing the size comparison. | |
That should work too. WDYT?