Skip to content

Commit

Permalink
gap: use GAP_NewPlist with a size hint
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jul 2, 2023
1 parent 853d070 commit 8d946b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/libs/gap/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cdef Obj make_gap_list(sage_list) except NULL:
The list of the elements in ``a`` as a Gap ``Obj``.
"""
cdef GapElement l = libgap.eval('[]')
cdef Obj l = GAP_NewPlist(len(sage_list))
cdef GapElement elem
for x in sage_list:
if not isinstance(x, GapElement):
Expand Down Expand Up @@ -77,7 +77,7 @@ cdef Obj make_gap_matrix(sage_list, gap_ring) except NULL:
The list of the elements in ``sage_list`` as a Gap ``Obj``.
"""
cdef GapElement l = libgap.eval('[]')
cdef Obj l = GAP_NewPlist(len(sage_list))
cdef GapElement elem
cdef GapElement one
if gap_ring is not None:
Expand Down

0 comments on commit 8d946b6

Please sign in to comment.