Permalink
Browse files

Check if we have a reference before calling ->degree (suboptimal) #1

  • Loading branch information...
1 parent 979a82a commit 04664297ffb649522f89a9edb0c3c7605f0d6b22 @leto committed Sep 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Math/Primality/BigPolynomial.pm
@@ -112,8 +112,8 @@ sub mpz_poly_mod_mult {
$rop->clear();
- my $xdeg = $x ? $x->degree() : 0;
- my $ydeg = $y ? $y->degree() : 0;
+ my $xdeg = ref $x ? $x->degree() : 0;
+ my $ydeg = ref $y ? $y->degree() : 0;
my $maxdeg = $xdeg < $ydeg ? $ydeg : $xdeg;
LOOP: for ( my $i = 0 ; $i < $polymod ; $i++ ) {

0 comments on commit 0466429

Please sign in to comment.