summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-10 22:03:48 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-10 22:03:48 +0000
commit83ee9561046f5c6b08ab7fa01781083214102a32 (patch)
treecd090ac8e248c193fa9586ba6786bc43fff337b5 /include/llvm
parenteb690d84918b1525214a3b29916ef81ff4d6def2 (diff)
downloadllvm-83ee9561046f5c6b08ab7fa01781083214102a32.tar.gz
llvm-83ee9561046f5c6b08ab7fa01781083214102a32.tar.bz2
llvm-83ee9561046f5c6b08ab7fa01781083214102a32.tar.xz
Simplify make_range by using move semantics
Move the iterators into the range the same way the range's ctor moves them into the members. Also remove some redundant top level parens in the return statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/ADT/iterator_range.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/iterator_range.h b/include/llvm/ADT/iterator_range.h
index 6735700e04..dd17d6c8f7 100644
--- a/include/llvm/ADT/iterator_range.h
+++ b/include/llvm/ADT/iterator_range.h
@@ -45,8 +45,8 @@ public:
///
/// This provides a bit of syntactic sugar to make using sub-ranges
/// in for loops a bit easier. Analogous to std::make_pair().
-template<class T> iterator_range<T> make_range(const T &x, const T &y) {
- return (iterator_range<T>(x, y));
+template <class T> iterator_range<T> make_range(T x, T y) {
+ return iterator_range<T>(std::move(x), std::move(y));
}
}