[tarantool-patches] [PATCH v3 4/7] lua: add non-recursive msgpack decoding functions

Konstantin Osipov kostja at tarantool.org
Thu Apr 18 20:35:28 MSK 2019


* Alexander Turenko <alexander.turenko at tarantool.org> [19/04/10 18:23]:
> Contracts:
> 
> ```
> msgpack.decode_array(buf.rpos, buf:size()) -> arr_len, new_rpos
> msgpack.decode_map(buf.rpos, buf:size()) -> map_len, new_rpos
> ```

>From what they do, they actually neither decode nor skip an
array/map. They decode array/map header only. I know that msgpuck
uses this naming, but it is actually confusing. Why not just
encode array/map header, but skip array/map  data in these functions and
and call them msgpack.skip_array(), msgpack.skip_map()
respectively? 
> +
> +	uint32_t len = mp_decode_array(&data);

This doesn't actually skip array members, does it.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov



More information about the Tarantool-patches mailing list