webmcp

changeset 273:5ff8d300817b

Tiny optimization in slot.put_into(...)
author jbe
date Sat Mar 21 14:37:11 2015 +0100 (2015-03-21)
parents a533ab6d7337
children d22b58cafebf
files framework/env/slot/put.lua framework/env/slot/put_into.lua
line diff
     1.1 --- a/framework/env/slot/put.lua	Fri Mar 20 16:58:31 2015 +0100
     1.2 +++ b/framework/env/slot/put.lua	Sat Mar 21 14:37:11 2015 +0100
     1.3 @@ -7,8 +7,8 @@
     1.4  
     1.5  This function is used to write strings into the active slot.
     1.6  
     1.7 --- NOTE: ACCELERATED FUNCTION
     1.8 --- Do not change unless also you also update webmcp_accelerator.c
     1.9 +NOTE: ACCELERATED FUNCTION
    1.10 +Do not change unless also you also update webmcp_accelerator.c
    1.11  
    1.12  --]]--
    1.13  
     2.1 --- a/framework/env/slot/put_into.lua	Fri Mar 20 16:58:31 2015 +0100
     2.2 +++ b/framework/env/slot/put_into.lua	Sat Mar 21 14:37:11 2015 +0100
     2.3 @@ -8,16 +8,14 @@
     2.4  
     2.5  This function is used to write strings into a named slot.
     2.6  
     2.7 --- NOTE: ACCELERATED FUNCTION
     2.8 --- Do not change unless also you also update webmcp_accelerator.c
     2.9 +NOTE: ACCELERATED FUNCTION
    2.10 +Do not change unless also you also update webmcp_accelerator.c
    2.11  
    2.12  --]]--
    2.13  
    2.14  function slot.put_into(slot_ident, ...)
    2.15    local t = slot._data[slot_ident].string_fragments
    2.16 -  for i = 1, math.huge do
    2.17 -    local v = select(i, ...)
    2.18 -    if v == nil then break end
    2.19 -    t[#t + 1] = v
    2.20 +  for i = 1, select("#", ...) do
    2.21 +    t[#t + 1] = select(i, ...)
    2.22    end
    2.23  end

Impressum / About Us