--- parser3/src/classes/string.C 2001/03/29 17:34:26 1.20 +++ parser3/src/classes/string.C 2001/03/29 17:44:38 1.21 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: string.C,v 1.20 2001/03/29 17:34:26 paf Exp $ + $Id: string.C,v 1.21 2001/03/29 17:44:38 paf Exp $ */ #include "pa_request.h" @@ -116,15 +116,12 @@ static void _lsplit(Request& r, const St Pool& pool=r.pool(); const String& string=*static_cast(r.self)->get_string(); - Array list(pool); - split_list(r, method_name, params, string, list); - Table& table=*new(pool) Table(pool, &string, 0/*nameless*/); + Array& row=*new(pool) Array(pool); + split_list(r, method_name, params, string, row); - int size=list.size(); - for(int i=0; i=0; ) { - Array& row=*new(pool) Array(pool, 1/*row preallocate(and only)*/); - table+=&(row+=list.get(i)); - } + Array& row=*new(pool) Array(pool); + for(int i=list.size(); --i>=0; ) + row+=list.get(i); + + Table& table=*new(pool) Table(pool, &string, + 0/*nameless*/, 1/*row preallocate(and only)*/); + table+=&row; r.write_no_lang(*new(pool) VTable(pool, &table)); }