[interchange-cvs] interchange - jon modified lib/Vend/Interpolate.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Wed Mar 3 11:07:31 EST 2004
User: jon
Date: 2004-03-03 16:07:30 GMT
Modified: lib/Vend Interpolate.pm
Log:
Fix mv_ip setting when using [item-list reverse=1].
I'd like to generalize this to allow iterate_*_list to accept a reverse=1
option which would have them walk the array in reverse order (rather than
first reversing the array, then handing it off, with all the speed loss),
and I think it would be a useful general array-walking feature.
However, iterate_hash_list alone has 3 different for loops which would
each have to be changed, and I can't think of a clean way to do either/or
for loops at the moment. Comments welcome.
Revision Changes Path
2.206 +3 -3 interchange/lib/Vend/Interpolate.pm
rev 2.206, prev_rev 2.205
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.205
retrieving revision 2.206
diff -u -u -r2.205 -r2.206
--- Interpolate.pm 17 Feb 2004 15:58:28 -0000 2.205
+++ Interpolate.pm 3 Mar 2004 16:07:30 -0000 2.206
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.205 2004/02/17 15:58:28 jon Exp $
+# $Id: Interpolate.pm,v 2.206 2004/03/03 16:07:30 jon Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.205 $, 10);
+$VERSION = substr(q$Revision: 2.206 $, 10);
@EXPORT = qw (
@@ -4431,7 +4431,7 @@
for ( ; $i <= $end; $i++, $count++) {
$item = $hash->[$i];
- $item->{mv_ip} = $i;
+ $item->{mv_ip} = $opt->{reverse} ? ($end - $i) : $i;
if($opt->{modular}) {
if($opt->{master}) {
next unless $item->{mv_mi} eq $opt->{master};
More information about the interchange-cvs
mailing list