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 7891C25B0D for ; Wed, 4 Sep 2019 07:57:38 -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 ByzSLlSxR5Bh for ; Wed, 4 Sep 2019 07:57:38 -0400 (EDT) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 8768225A8D for ; Wed, 4 Sep 2019 07:57:33 -0400 (EDT) Received: by mail-lj1-f194.google.com with SMTP id y23so8222983lje.9 for ; Wed, 04 Sep 2019 04:57:33 -0700 (PDT) Date: Tue, 3 Sep 2019 11:26:05 +0300 From: Cyrill Gorcunov Subject: [tarantool-patches] Re: [PATCH 1/5] box/console: Add mapping for direct symbols Message-ID: <20190903082605.GI2801@uranus.lan> References: <20190830214808.17422-1-gorcunov@gmail.com> <20190830214808.17422-2-gorcunov@gmail.com> <20190903082351.GB9438@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190903082351.GB9438@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 , Kirill Yukhin On Tue, Sep 03, 2019 at 11:23:51AM +0300, Konstantin Osipov wrote: > > + for k,v in pairs(map_direct_symbols) do > > + if k == ... then > > + return v .. output_eos["lua"] > > + end > > + end > > Please do not concatenate strings in a loop in Lua: it is O(n^2) > of the total length, since there is a resize/realloc on each > concatenation. The cycle breaks once it matches, note the "return" statement here. Or you meant something else?