From: David Blaikie Date: Thu, 10 Apr 2014 22:03:48 +0000 (+0000) Subject: Simplify make_range by using move semantics X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=83ee9561046f5c6b08ab7fa01781083214102a32;p=oota-llvm.git 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 --- diff --git a/include/llvm/ADT/iterator_range.h b/include/llvm/ADT/iterator_range.h index 6735700e046..dd17d6c8f7b 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 iterator_range make_range(const T &x, const T &y) { - return (iterator_range(x, y)); +template iterator_range make_range(T x, T y) { + return iterator_range(std::move(x), std::move(y)); } }