changeset 261:57ded86f87b7 misc

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 08 Mar 2015 05:35:08 +0200
parents 34a480682139
children d26cf08d9bf0
files materials/parsematerial.pl
diffstat 1 files changed, 7 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/materials/parsematerial.pl	Sun Mar 08 05:01:58 2015 +0200
+++ b/materials/parsematerial.pl	Sun Mar 08 05:35:08 2015 +0200
@@ -636,28 +636,19 @@
 elsif ($opt_mode eq "-php")
 {
   print "<?\n".
-  "\$transNameTable = array(";
-  foreach my $info (@fieldInfo) {
-    print "\"".$$info{"l"}."\",";
-  }
-  print ");\n\n".
+  "\$transNameTable = array(".
+  join(",", map { "\"".$$_{"l"}."\"" } @fieldInfo).
+  ");\n\n".
   "\$transTable = array(\n";
   foreach my $i (sort { $a <=> $b } keys %transTable)
   {
     print "  array(";
     foreach my $j (keys %{$transTable{$i}})
     {
-      if (defined($transTable{$i}{$j}))
-      {
-        print $transTable{$i}{$j};
-        $j =~ s/very /v./;
-        $j =~ s/incredibly /incr./;
-        print " => \"$j\","
-      }
-      else
-      {
-        print STDERR "$0: Unknown transTable type $i : $j\n";
-      }
+      print $transTable{$i}{$j};
+      $j =~ s/very /v./;
+      $j =~ s/incredibly /incr./;
+      print " => \"".$j."\","
     }
     print "),\n";
   }