From f1787008295aa274490a5723d5556b3c92045604 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 7 Jul 2008 18:39:33 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/STLExtras.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index f1883959d76..5c5e4aa9444 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 inline ItTy next(ItTy it) { - std::advance(it, 1); - return it; + return ++it; } template @@ -151,8 +150,7 @@ inline ItTy prior(ItTy it, Dist n) template inline ItTy prior(ItTy it) { - std::advance(it, -1); - return it; + return --it; } //===----------------------------------------------------------------------===// -- 2.34.1