[llvm-commits] [llvm] r53189 - /llvm/trunk/include/llvm/ADT/STLExtras.h
Dan Gohman
gohman at apple.com
Mon Jul 7 11:39:33 PDT 2008
Author: djg
Date: Mon Jul 7 13:39:33 2008
New Revision: 53189
URL: http://llvm.org/viewvc/llvm-project?rev=53189&view=rev
Log:
Don't use std::advance just to increment or decrement by one.
Modified:
llvm/trunk/include/llvm/ADT/STLExtras.h
Modified: llvm/trunk/include/llvm/ADT/STLExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=53189&r1=53188&r2=53189&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/STLExtras.h Mon Jul 7 13:39:33 2008
@@ -137,8 +137,7 @@
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 @@
template <typename ItTy>
inline ItTy prior(ItTy it)
{
- std::advance(it, -1);
- return it;
+ return --it;
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list