[ADT] Avoid needless iterator copies in `zippy`
authorJakub Kuderski <kubak@google.com>
Mon, 6 Mar 2023 19:39:39 +0000 (14:39 -0500)
committerJakub Kuderski <kubak@google.com>
Mon, 6 Mar 2023 19:39:40 +0000 (14:39 -0500)
commit38774c4f39a78deab1dd35ff45bc557300cd9b29
tree578e05acd6aaf79fd2cbe115df76c1bfc2ef2ca3
parenta6e3bb9bfbd0cce075e4e8809ba349fdcc2feb34
[ADT] Avoid needless iterator copies in `zippy`

Make `zip_common` increment and decrement iterators in place.

This improves performance with iterator types that have non-triviall
copy constructors.

Reviewed By: zero9178

Differential Revision: https://reviews.llvm.org/D145337
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/IteratorTest.cpp