Skip to content

Commit

Permalink
get rid of one ParentWithGens
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Dec 15, 2023
1 parent e2e0f8d commit 086a13f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/sage/rings/polynomial/ore_polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ from sage.structure.element import coerce_binop
from sage.rings.infinity import infinity
from sage.structure.element cimport Element, RingElement, AlgebraElement
from sage.structure.parent cimport Parent
from sage.structure.parent_gens cimport ParentWithGens
from sage.categories.homset import Hom
from sage.rings.ring import _Fields
from sage.rings.integer cimport Integer
Expand Down Expand Up @@ -2338,9 +2337,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
cdef long c_hash
cdef long var_name_hash = 0
cdef int i
for i from 0 <= i < len(self._coeffs):
for i in range(len(self._coeffs)):
if i == 1:
var_name_hash = hash((<ParentWithGens>self._parent)._names[0])
var_name_hash = hash(self._parent._names[0])
c_hash = hash(self._coeffs[i])
if c_hash != 0:
if i == 0:
Expand Down Expand Up @@ -2576,9 +2575,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
cdef list y = (<OrePolynomial_generic_dense>right)._coeffs
cdef Py_ssize_t dx = len(x), dy = len(y)
if dx > dy:
r = self._new_c([x[i] + y[i] for i from 0 <= i < dy] + x[dy:], self._parent, 0)
r = self._new_c([x[i] + y[i] for i in range(dy)] + x[dy:], self._parent, 0)
elif dx < dy:
r = self._new_c([x[i] + y[i] for i from 0 <= i < dx] + y[dx:], self._parent, 0)
r = self._new_c([x[i] + y[i] for i in range(dx)] + y[dx:], self._parent, 0)
else:
r = self._new_c([x[i] + y[i] for i in range(dx)], self._parent, 1)
return r
Expand Down

0 comments on commit 086a13f

Please sign in to comment.