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; } //===----------------------------------------------------------------------===//