|
21 | 21 | #include "llvm/ADT/Hashing.h" |
22 | 22 | #include "llvm/ADT/STLForwardCompat.h" |
23 | 23 | #include "llvm/ADT/STLFunctionalExtras.h" |
24 | | -#include "llvm/ADT/StringRef.h" |
25 | 24 | #include "llvm/ADT/iterator.h" |
26 | 25 | #include "llvm/ADT/iterator_range.h" |
27 | 26 | #include "llvm/Config/abi-breaking.h" |
@@ -2216,12 +2215,13 @@ inline void interleave(const Container &c, UnaryFunctor each_fn, |
2216 | 2215 | template <typename Container, typename UnaryFunctor, typename StreamT, |
2217 | 2216 | typename T = detail::ValueOfRange<Container>> |
2218 | 2217 | inline void interleave(const Container &c, StreamT &os, UnaryFunctor each_fn, |
2219 | | - StringRef separator) { |
| 2218 | + const StringRef &separator) { |
2220 | 2219 | interleave(adl_begin(c), adl_end(c), each_fn, [&] { os << separator; }); |
2221 | 2220 | } |
2222 | 2221 | template <typename Container, typename StreamT, |
2223 | 2222 | typename T = detail::ValueOfRange<Container>> |
2224 | | -inline void interleave(const Container &c, StreamT &os, StringRef separator) { |
| 2223 | +inline void interleave(const Container &c, StreamT &os, |
| 2224 | + const StringRef &separator) { |
2225 | 2225 | interleave( |
2226 | 2226 | c, os, [&](const T &a) { os << a; }, separator); |
2227 | 2227 | } |
|
0 commit comments