avoid some unnecessary allocations

[?]
Jul 24, 2023, 7:44 AM
SM7UNXQMKBTBJBR7LWL5LV2SSWQ4OGWCUNHYPAZ2DUH5UXIZXBDQC

Dependencies

  • [2] AQRAWL63 don't tolerate Lua comments when parsing commands
  • [3] VA7NGQLG ignore comments when selecting buffer name
  • [4] LRDM35CE app running again
  • [5] GXE3ESLG abstraction: roll forward/back
  • [6] BSDXVB3H backport some doc updates and renames

Change contents

  • edit in live.lua at line 233
    [3.938]
    [2.131]
    -- return the first word
  • replacement in live.lua at line 238
    [2.219][3.10:65](),[3.938][3.10:65]()
    return buf:gsub('%-%-[^\n]*', ''):match('^%s*(%S+)')
    [2.219]
    [3.970]
    -- Return the first word, after skipping Lua comments.
    if not buf:match('^%s*%-%-') then
    return buf:match('^%s*(%S+)') -- avoid unnecessary allocations
    end
    -- wastefully strip out comments everywhere, not just at the start
    buf = buf:gsub('%-%-[^\n]*', '') -- line comments
    return buf:match('^%s*(%S+)')