diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-08-25 17:08:25 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-08-30 12:16:17 +0200 |
commit | 4efc19b734c108353f8ad7c6e65ee5d33e8abbbf (patch) | |
tree | 203133204487b4bf4a53eb2dd6cb4a5b8acd5d98 /configpm | |
parent | c148612c755ee021cf3509e164fe0c04ec486cb7 (diff) | |
download | perl-4efc19b734c108353f8ad7c6e65ee5d33e8abbbf.tar.gz |
Generate $Config::Config{byteorder} slightly more efficiently.
Diffstat (limited to 'configpm')
-rwxr-xr-x | configpm | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -412,13 +412,12 @@ my $f = $t eq 'long' ? 'L!' : $s == 8 ? 'Q': 'I'; my $byteorder_code; if ($s == 4 || $s == 8) { - my $list = join ',', reverse(2..$s); + my $list = join ',', reverse(1..$s-1); my $format = 'a'x$s; $byteorder_code = <<"EOT"; -my \$i = 0; -foreach my \$c ($list) { \$i |= ord(\$c); \$i <<= 8 } -\$i |= ord(1); +my \$i = ord($s); +foreach my \$c ($list) { \$i <<= 8; \$i |= ord(\$c); } our \$byteorder = join('', unpack('$format', pack('$f', \$i))); EOT } else { |