aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-07 18:39:33 +0000
committerDan Gohman <gohman@apple.com>2008-07-07 18:39:33 +0000
commit144f65a292cc236586f2c8130c27f45514dc71c7 (patch)
tree92b8084353f44c2d13ac2bf4f7d3e3319464dfce /include
parent42160765554666a1669d238d691748e38bca7120 (diff)
downloadexternal_llvm-144f65a292cc236586f2c8130c27f45514dc71c7.zip
external_llvm-144f65a292cc236586f2c8130c27f45514dc71c7.tar.gz
external_llvm-144f65a292cc236586f2c8130c27f45514dc71c7.tar.bz2
Don't use std::advance just to increment or decrement by one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/STLExtras.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h
index f188395..5c5e4aa 100644
--- a/include/llvm/ADT/STLExtras.h
+++ b/include/llvm/ADT/STLExtras.h
@@ -137,8 +137,7 @@ inline ItTy next(ItTy it, Dist n)
template <typename ItTy>
inline ItTy next(ItTy it)
{
- std::advance(it, 1);
- return it;
+ return ++it;
}
template <typename ItTy, typename Dist>
@@ -151,8 +150,7 @@ inline ItTy prior(ItTy it, Dist n)
template <typename ItTy>
inline ItTy prior(ItTy it)
{
- std::advance(it, -1);
- return it;
+ return --it;
}
//===----------------------------------------------------------------------===//