[wellwell-devel] [wellwell/zoom] Discard elements from repeated lists in [zoom init].

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Mon Sep 6 12:18:13 UTC 2010


commit d9a3b763ae287271f0947e7b2552938bf3dce89b
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Mon Sep 6 13:08:28 2010 +0200

    Discard elements from repeated lists in [zoom init].

 lib/WellWell/Zoom.pm |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lib/WellWell/Zoom.pm b/lib/WellWell/Zoom.pm
index 32b3118..fa7ae08 100644
--- a/lib/WellWell/Zoom.pm
+++ b/lib/WellWell/Zoom.pm
@@ -213,11 +213,23 @@ sub parse_handler {
 		}
 		
 		if ($sob->{type} eq 'list') {
+			if (exists $sref->{lists}->{$name}) {
+				# discard repeated lists
+				$elt->cut();
+				return;
+			}
+			
 			$sob->{elts} = [$elt];
 
 			$sref->{lists}->{$name} = [$sob];
+			return $sref;
 		}
-		elsif ($sob->{type} eq 'param') {
+
+		if (exists $sref->{lists}->{$sob->{list}}) {
+			return $sref;
+		}
+
+		if ($sob->{type} eq 'param') {
 			push (@{$sob->{elts}}, $elt);
 
 			if ($gi eq 'input') {



More information about the wellwell-devel mailing list