--- parser3/src/include/pa_array.h 2024/10/07 23:46:24 1.97 +++ parser3/src/include/pa_array.h 2024/11/04 03:53:25 1.100 @@ -1,14 +1,14 @@ /** @file Parser: Array & Array_iterator classes decls. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_ARRAY_H #define PA_ARRAY_H -#define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.97 2024/10/07 23:46:24 moko Exp $" +#define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.100 2024/11/04 03:53:25 moko Exp $" // includes @@ -108,14 +108,11 @@ public: } /// append other Array portion to this one. starting from offset - Array& append(const Array& src, - size_t offset=0, - size_t limit=ARRAY_OPTION_LIMIT_ALL) { //< zero limit means 'nothing' - + void append(const Array& src, size_t offset=0, size_t limit=ARRAY_OPTION_LIMIT_ALL) { //< zero limit means 'nothing' size_t src_count=src.count(); // skip tivials if(!src_count || !limit || offset>=src_count) - return *this; + return; // max(limit) size_t m=src_count-offset; // fix limit @@ -123,13 +120,8 @@ public: limit=m; fit(fsize-1+limit); - - T* from=&src.felements[offset]; - T* to=&felements[fsize]; - for(T* from_end=from+limit; from= fallocated) - resize(max(this->fallocated + this->fallocated/4, index+1)); + resize(max(fallocated+fallocated/4, index+1)); } void resize(size_t asize) {