Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48986 - sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor
From: ockham_at_[hidden]
Date: 2008-09-27 17:00:31


Author: bernhard.reiter
Date: 2008-09-27 17:00:31 EDT (Sat, 27 Sep 2008)
New Revision: 48986
URL: http://svn.boost.org/trac/boost/changeset/48986

Log:
Slight optimisation.
Text files modified:
   sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/_order_iterative.hpp | 15 +++++++++------
   1 files changed, 9 insertions(+), 6 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/_order_iterative.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/_order_iterative.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/detail/algorithm/cursor/_order_iterative.hpp 2008-09-27 17:00:31 EDT (Sat, 27 Sep 2008)
@@ -16,8 +16,9 @@
 template <class Cursor, class Op>
 Op for_each(root_tracking_cursor<Cursor> s, Op f)
 {
- root_tracking_cursor<Cursor> s2 = last(s);
- s = first(s);
+ root_tracking_cursor<Cursor> s2(s);
+ to_first(s);
+ to_last(s2);
     while (s!=s2) {
         f(*s);
         forward(s);
@@ -46,8 +47,9 @@
 template <class InCursor, class OutCursor>
 OutCursor copy (root_tracking_cursor<InCursor> s, OutCursor t)
 {
- root_tracking_cursor<InCursor> s2(last(s));
- s = first(s);
+ root_tracking_cursor<InCursor> s2(s);
+ to_first(s);
+ to_last(s2);
     while (s!=s2) {
         *t = *s;
         forward(s);
@@ -70,8 +72,9 @@
 template <class InCursor, class OutCursor, class Op>
 OutCursor transform (root_tracking_cursor<InCursor> s, OutCursor t, Op op)
 {
- root_tracking_cursor<InCursor> s2(last(s));
- s = first(s);
+ root_tracking_cursor<InCursor> s2(s);
+ to_first(s);
+ to_last(s2);
     while (s!=s2) {
         *t = op(*s);
         forward(s);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk