File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ cdef class Keyword:
3838 cdef int _hash
3939
4040 @staticmethod
41- cdef Keyword from_ptr(C.Keyword * )
41+ cdef Keyword from_ptr(C.Keyword * , Keyword inst = * )
4242
4343
4444cdef class Maintainer(Indirect):
Original file line number Diff line number Diff line change @@ -251,14 +251,13 @@ cdef class Keyword:
251251 if ptr is NULL :
252252 raise PkgcraftError
253253
254- self .status = KeywordStatus(ptr.status)
255- self .arch = ptr.arch.decode()
256- self .ptr = ptr
254+ Keyword.from_ptr(ptr, self )
257255
258256 @staticmethod
259- cdef Keyword from_ptr(C.Keyword * ptr):
257+ cdef Keyword from_ptr(C.Keyword * ptr, Keyword inst = None ):
260258 """ Create a Keyword from a pointer."""
261- inst = < Keyword> Keyword.__new__ (Keyword)
259+ if inst is None :
260+ inst = < Keyword> Keyword.__new__ (Keyword)
262261 inst.status = KeywordStatus(ptr.status)
263262 inst.arch = ptr.arch.decode()
264263 inst.ptr = ptr
You can’t perform that action at this time.
0 commit comments