summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-08-25 17:08:25 +0200
committerNicholas Clark <nick@ccl4.org>2011-08-30 12:16:17 +0200
commit4efc19b734c108353f8ad7c6e65ee5d33e8abbbf (patch)
tree203133204487b4bf4a53eb2dd6cb4a5b8acd5d98 /configpm
parentc148612c755ee021cf3509e164fe0c04ec486cb7 (diff)
downloadperl-4efc19b734c108353f8ad7c6e65ee5d33e8abbbf.tar.gz
Generate $Config::Config{byteorder} slightly more efficiently.
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm7
1 files changed, 3 insertions, 4 deletions
diff --git a/configpm b/configpm
index bea9ef5d44..33811eec27 100755
--- a/configpm
+++ b/configpm
@@ -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 {