[tarantool-patches] Re: [PATCH 1/5] box/console: Add mapping for direct symbols
Cyrill Gorcunov
gorcunov at gmail.com
Tue Sep 3 11:26:05 MSK 2019
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?
More information about the Tarantool-patches
mailing list