|
|
| version 1.20, 2001/03/29 17:34:26 | version 1.21, 2001/03/29 17:44:38 |
|---|---|
| Line 116 static void _lsplit(Request& r, const St | Line 116 static void _lsplit(Request& r, const St |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| const String& string=*static_cast<VString *>(r.self)->get_string(); | const String& string=*static_cast<VString *>(r.self)->get_string(); |
| Array list(pool); | Array& row=*new(pool) Array(pool); |
| split_list(r, method_name, params, string, list); | split_list(r, method_name, params, string, row); |
| Table& table=*new(pool) Table(pool, &string, 0/*nameless*/); | |
| int size=list.size(); | Table& table=*new(pool) Table(pool, &string, |
| for(int i=0; i<size; i++) { | 0/*nameless*/, 1/*row preallocate(and only)*/); |
| Array& row=*new(pool) Array(pool, 1/*row preallocate(and only)*/); | table+=&row; |
| table+=&(row+=list.quick_get(i)); | |
| } | |
| r.write_no_lang(*new(pool) VTable(pool, &table)); | r.write_no_lang(*new(pool) VTable(pool, &table)); |
| } | } |
| Line 135 static void _rsplit(Request& r, const St | Line 132 static void _rsplit(Request& r, const St |
| Array list(pool); | Array list(pool); |
| split_list(r, method_name, params, string, list); | split_list(r, method_name, params, string, list); |
| Table& table=*new(pool) Table(pool, &string, 0/*nameless*/); | |
| for(int i=list.size(); --i>=0; ) { | Array& row=*new(pool) Array(pool); |
| Array& row=*new(pool) Array(pool, 1/*row preallocate(and only)*/); | for(int i=list.size(); --i>=0; ) |
| table+=&(row+=list.get(i)); | 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)); | r.write_no_lang(*new(pool) VTable(pool, &table)); |
| } | } |