--- parser3/src/main/Attic/pa_array.C 2001/03/29 17:11:41 1.30 +++ parser3/src/main/Attic/pa_array.C 2001/05/15 15:51:05 1.32 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_array.C,v 1.30 2001/03/29 17:11:41 paf Exp $ + $Id: pa_array.C,v 1.32 2001/05/15 15:51:05 parser Exp $ */ #include "pa_config_includes.h" @@ -47,7 +47,7 @@ void Array::expand(int chunk_rows) { Array& Array::operator += (Item *src) { if(chunk_is_full()) - expand(tail->count*CR_GROW_PERCENT/100); + expand(tail->count+CR_GROW_COUNT); append_here->item=src; append_here++; fused_rows++; @@ -167,6 +167,22 @@ void Array::for_each(For_each_func func, } } +/*void Array::for_each(For_each_func_const func, const void *info) const { + Chunk *chunk=head; + while(true) { + if(chunk==tail) { // last chunk? + for(Chunk::Row *row=chunk->rows; row!=append_here; row++) + (*func)(row->item, info); + break; + } else { + int count=chunk->count; + for(int i=0; irows[i].item, info); + chunk=chunk->rows[count].link; + } + } +} +*/ Array::Item* Array::first_that(First_that_func_const func, const void *info) const { Chunk *chunk=head; while(true) {