commit cfcf2008069fc2d5574e10303dbe4f1ea3188636
parent f32a8c04772bf9d78dbdc920cfad148deff08fab
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 26 Jun 2002 16:27:46 -0300
`concat' goes to `table' library
Diffstat:
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git 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},