From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 18 Apr 2019 20:35:28 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH v3 4/7] lua: add non-recursive msgpack decoding functions Message-ID: <20190418173528.GL13022@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: tarantool-patches@freelists.org Cc: Vladimir Davydov , Alexander Turenko List-ID: * Alexander Turenko [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