From cfcf2008069fc2d5574e10303dbe4f1ea3188636 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 26 Jun 2002 16:28:08 -0300 Subject: [PATCH] `concat' goes to `table' library --- lstrlib.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lstrlib.c b/lstrlib.c index 540c13a0..9877a826 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.85 2002/06/18 15:16:18 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.86 2002/06/25 19:16:44 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -92,25 +92,6 @@ static int str_rep (lua_State *L) { } -static int str_concat (lua_State *L) { - luaL_Buffer b; - size_t lsep; - const char *sep = luaL_opt_lstr(L, 2, "", &lsep); - int n, i; - luaL_check_type(L, 1, LUA_TTABLE); - luaL_buffinit(L, &b); - n = lua_getn(L, 1); - for (i=1; i<=n; i++) { - lua_rawgeti(L, 1, i); - luaL_addvalue(&b); - if (i != n) - luaL_addlstring(&b, sep, lsep); - } - luaL_pushresult(&b); - return 1; -} - - static int str_byte (lua_State *L) { size_t l; const char *s = luaL_check_lstr(L, 1, &l); @@ -713,7 +694,6 @@ static const luaL_reg strlib[] = { {"char", str_char}, {"rep", str_rep}, {"byte", str_byte}, - {"concat", str_concat}, {"format", str_format}, {"find", str_find}, {"gfind", gfind},