validator/httpd/cgi-bin check,1.416,1.417

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv24157

Modified Files:
	check 
Log Message:
uniq'ing the list of non-root namespaces before passing it to results template 



Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.416
retrieving revision 1.417
diff -u -d -r1.416 -r1.417
--- check	9 May 2005 05:51:33 -0000	1.416
+++ check	9 May 2005 08:55:31 -0000	1.417
@@ -935,6 +935,14 @@
   #
   # Namespaces...
   $T->param(file_namespace  => $File->{Namespace});
+  my %seen_ns = ();
+  my @bulk_ns =  @{$File->{Namespaces}};
+  $File->{Namespaces} = []; # reinitialize the list of non-root namespaces
+  my  $single_namespace;
+  # ... and then get a uniq version of it
+  foreach $single_namespace (@bulk_ns) {
+     push(@{$File->{Namespaces}}, $single_namespace) unless $seen_ns{$single_namespace}++;
+  }
   my @nss                   =  map({uri => $_}, @{$File->{Namespaces}});
   $T->param(file_namespaces => \@nss) if @nss;
   

Received on Monday, 9 May 2005 08:55:46 UTC