From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 58319442BB9 for ; Tue, 24 Mar 2020 01:32:14 +0300 (MSK) References: <1f571d45-179d-1b72-941d-3de21c2e8f11@tarantool.org> <4a6edd2a-7173-706c-0622-a805b152dc70@tarantool.org> <228c747e-13b4-10a1-7626-9ee4ad99567a@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Mon, 23 Mar 2020 23:32:12 +0100 MIME-Version: 1.0 In-Reply-To: <228c747e-13b4-10a1-7626-9ee4ad99567a@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH vshard 2/2] storage: introduce vshard.storage._call() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Oleg Babin , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org On 23/03/2020 07:42, Oleg Babin wrote: > On 22/03/2020 22:13, Vladislav Shpilevoy wrote: >>>> + >>>> +local function service_call(...) >>>> +    local service_name = select(1, ...) >>>> +    return service_call_api[service_name](select(2, ...)) >>>> +end >>> > > What's about a following diff? > ============ > diff --git a/vshard/storage/init.lua b/vshard/storage/init.lua > index 6aa5d6a..3653914 100644 > --- a/vshard/storage/init.lua > +++ b/vshard/storage/init.lua > @@ -2203,9 +2203,8 @@ service_call_api = setmetatable({ >      return res >  end}) > > -local function service_call(...) > -    local service_name = select(1, ...) > -    return service_call_api[service_name](select(2, ...)) > +local function service_call(service_name, ...) > +    return service_call_api[service_name](...) >  end > ============ Indeed, that looks better. I missed that I could declare first argument separately. Applied.