From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6586624605 for ; Sun, 28 Jul 2019 17:43:47 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9iarOZP7WQ1D for ; Sun, 28 Jul 2019 17:43:47 -0400 (EDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 1E50F245EC for ; Sun, 28 Jul 2019 17:43:47 -0400 (EDT) Received: by mail-lj1-f169.google.com with SMTP id p17so56598958ljg.1 for ; Sun, 28 Jul 2019 14:43:46 -0700 (PDT) Date: Mon, 29 Jul 2019 00:43:44 +0300 From: Cyrill Gorcunov Subject: [tarantool-patches] Re: [PATCH 1/3] box/console: Don't allow arguments in get_default_output Message-ID: <20190728214344.GD29098@uranus> References: <20190726221712.11191-1-gorcunov@gmail.com> <20190726221712.11191-2-gorcunov@gmail.com> <20190728184422.GA13676@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190728184422.GA13676@atlas> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Konstantin Osipov Cc: tml , Alexander Turenko On Sun, Jul 28, 2019 at 09:44:22PM +0300, Konstantin Osipov wrote: > * Cyrill Gorcunov [19/07/27 01:21]: > > -local function get_default_output() > > +local function get_default_output(...) > > + local args = ... > > I think it's enough to check for a single argument, variadic > arguments introduce unnecessary overhead. Good point, thanks! > > + if args ~= nil then > > + error("Arguments provided while prohibited") > > error("This function accepts no arguments") OK > > + end > > return default_output_format > > end > > Please add a test case. > Otherwise lgtm. Will rework and resend.