diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-07 18:39:33 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-07 18:39:33 +0000 |
| commit | 125919217a8ce245329e6b3545ca7e49361c6742 (patch) | |
| tree | 1efce36bb16d3b1d2e901c7ba12535468ac78e43 | |
| parent | ff702ad891fa7c94b9b994170abc08ed680acad0 (diff) | |
| download | bcm5719-llvm-125919217a8ce245329e6b3545ca7e49361c6742.tar.gz bcm5719-llvm-125919217a8ce245329e6b3545ca7e49361c6742.zip | |
Don't use std::advance just to increment or decrement by one.
llvm-svn: 53189
| -rw-r--r-- | llvm/include/llvm/ADT/STLExtras.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index f1883959d76..5c5e4aa9444 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/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; } //===----------------------------------------------------------------------===// |

