Don't use std::advance just to increment or decrement by one.
authorDan Gohman <gohman@apple.com>
Mon, 7 Jul 2008 18:39:33 +0000 (18:39 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 7 Jul 2008 18:39:33 +0000 (18:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/STLExtras.h

index f1883959d762c351250bfc6388ac772a409bfdf2..5c5e4aa9444f0a7edf4a30064116ad06c70c41db 100644 (file)
@@ -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;
 }
 
 //===----------------------------------------------------------------------===//