aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/STLExtras.h
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
commitf1787008295aa274490a5723d5556b3c92045604 (patch)
tree92b8084353f44c2d13ac2bf4f7d3e3319464dfce /include/llvm/ADT/STLExtras.h
parent7698252750b29bbd8de20f5404241953221470f4 (diff)
downloadexternal_llvm-f1787008295aa274490a5723d5556b3c92045604.zip
external_llvm-f1787008295aa274490a5723d5556b3c92045604.tar.gz
external_llvm-f1787008295aa274490a5723d5556b3c92045604.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/llvm/ADT/STLExtras.h')
-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;
}
//===----------------------------------------------------------------------===//