mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
Preallocate hv keys
This commit is contained in:
parent
7c1e0ea95d
commit
bd887b660d
1 changed files with 2 additions and 1 deletions
|
|
@ -157,10 +157,11 @@ STATIC_INLINE int template_callback_array_item(unpack_user* u PERL_UNUSED_DECL,
|
|||
return 0;
|
||||
}
|
||||
|
||||
STATIC_INLINE int template_callback_map(unpack_user* u PERL_UNUSED_DECL, unsigned int n PERL_UNUSED_DECL, SV** o)
|
||||
STATIC_INLINE int template_callback_map(unpack_user* u PERL_UNUSED_DECL, unsigned int n, SV** o)
|
||||
{
|
||||
dTHX;
|
||||
HV* const h = newHV();
|
||||
hv_ksplit(h, n);
|
||||
*o = newRV_noinc((SV*)h);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue