"Don't repeat yourself" in regen/opcode.pl
authorNicholas Clark <nick@ccl4.org>
Sat, 22 Jan 2011 22:19:45 +0000 (22:19 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 22 Jan 2011 22:19:45 +0000 (22:19 +0000)
regen/opcode.pl

index 9d314f2..4515424 100755 (executable)
@@ -487,11 +487,10 @@ sub gen_op_is_macro {
     }
 }
 
-print $oc "/* ex: set ro: */\n";
-print $on "/* ex: set ro: */\n";
-
-safer_close($oc);
-safer_close($on);
+foreach ($oc, $on) {
+    print $_ "/* ex: set ro: */\n";
+    safer_close($_);
+}
 
 rename_if_different $opcode_new, 'opcode.h';
 rename_if_different $opname_new, 'opnames.h';