From 8d946b68f684378351761ab28a7fa84c12567d74 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 2 Jul 2023 13:08:49 +0200 Subject: [PATCH] gap: use GAP_NewPlist with a size hint --- src/sage/libs/gap/element.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index 6341a37c85f..1e30549e8d7 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -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): @@ -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: