Merge pull request #123 from GlitchMr/shorten-xor
ord(chr()) does nothing on integer, it's uselessmaster
commit
5a8d77a2d5
|
@ -11,7 +11,7 @@ handle query_raw => sub {
|
||||||
my @nums = grep(!/(xor|⊕)/, split(/\s+(⊕|xor)\s+/i, $_));
|
my @nums = grep(!/(xor|⊕)/, split(/\s+(⊕|xor)\s+/i, $_));
|
||||||
my $num = 0;
|
my $num = 0;
|
||||||
foreach (@nums) {
|
foreach (@nums) {
|
||||||
$num ^= ord(chr($_)) if /^\d+$/;
|
$num ^= $_ if /^\d+$/;
|
||||||
return unless /^\d+$/;
|
return unless /^\d+$/;
|
||||||
}
|
}
|
||||||
return "$num" if $num;
|
return "$num" if $num;
|
||||||
|
|
Loading…
Reference in New Issue