markup-validator commit: Code cleanups.

changeset:   3199:da888ce9f014
tag:         tip
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Thu Dec 16 17:35:30 2010 +0200
files:       httpd/cgi-bin/check
description:
Code cleanups.


diff -r 6dbe979d2d79 -r da888ce9f014 httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Thu Dec 16 17:33:20 2010 +0200
+++ b/httpd/cgi-bin/check	Thu Dec 16 17:35:30 2010 +0200
@@ -1314,7 +1314,6 @@
     &override_charset($File, "UTF-8");
 
     eval { $xmlparser->parse_string(join("\n", @{$File->{Content}})); };
-    my @xmlwf_error_list;
 
     if (ref($@)) {
 
@@ -1333,7 +1332,7 @@
 
             $err_obj = $err_obj->_prev();
 
-            unshift(@xmlwf_error_list, $err);
+            unshift(@{$File->{WF_Errors}}, $err);
         }
     }
     elsif ($@) {
@@ -1423,18 +1422,15 @@
                 $err->{type} = "E";
                 $err->{msg}  = $xmlwf_error_msg;
 
-                push(@xmlwf_error_list, $err);
+                push(@{$File->{WF_Errors}}, $err);
                 $xmlwf_error_line = undef;
                 $xmlwf_error_col  = undef;
                 $xmlwf_error_msg  = undef;
             }
         }
     }
-    foreach my $errmsg (@xmlwf_error_list) {
-        $File->{'Is Valid'} = FALSE;
-        push @{$File->{WF_Errors}}, $errmsg;
-    }
-
+
+    $File->{'Is Valid'} = FALSE if @{$File->{WF_Errors}};
     return $File;
 }
 
@@ -2385,9 +2381,7 @@
     # for the sake of readability, at least until the xmlwf errors have
     # explanations, we push the errors from the XML parser at the END of the
     # error list.
-    foreach my $errmsg (@{$File->{WF_Errors}}) {
-        push @{$File->{Errors}}, $errmsg;
-    }
+    push @{$File->{Errors}}, @{$File->{WF_Errors}};
 
     if (scalar @{$File->{Errors}}) {
         foreach my $err (@{$File->{Errors}}) {

Received on Thursday, 16 December 2010 15:35:55 UTC