|
|
| version 1.94, 2024/09/16 23:22:52 | version 1.97, 2024/10/07 23:46:24 |
|---|---|
| Line 53 public: | Line 53 public: |
| bool defined; | bool defined; |
| Action_options( | Action_options( |
| size_t aoffset=0, | size_t aoffset=0, |
| size_t alimit=ARRAY_OPTION_LIMIT_ALL, | size_t alimit=ARRAY_OPTION_LIMIT_ALL, |
| bool areverse=false): | bool areverse=false): |
| offset(aoffset), limit(alimit), reverse(areverse), | offset(aoffset), limit(alimit), reverse(areverse), |
| defined(false) {} | defined(false) {} |
| Line 71 public: | Line 71 public: |
| if(!m) | if(!m) |
| return false; | return false; |
| // fix limit | // fix limit |
| if(limit==ARRAY_OPTION_LIMIT_ALL || limit>m) | if(limit>m) |
| limit=m; | limit=m; |
| return true; | return true; |
| Line 110 public: | Line 110 public: |
| /// append other Array portion to this one. starting from offset | /// append other Array portion to this one. starting from offset |
| Array& append(const Array& src, | Array& append(const Array& src, |
| size_t offset=0, | size_t offset=0, |
| size_t limit=ARRAY_OPTION_LIMIT_ALL) { //< negative limit means 'all'. zero limit means 'nothing' | size_t limit=ARRAY_OPTION_LIMIT_ALL) { //< zero limit means 'nothing' |
| size_t src_count=src.count(); | size_t src_count=src.count(); |
| // skip tivials | // skip tivials |
| Line 119 public: | Line 119 public: |
| // max(limit) | // max(limit) |
| size_t m=src_count-offset; | size_t m=src_count-offset; |
| // fix limit | // fix limit |
| if(limit==ARRAY_OPTION_LIMIT_ALL || limit>m) | if(limit>m) |
| limit=m; | limit=m; |
| fit(fsize-1+limit); | fit(fsize-1+limit); |
| Line 221 protected: | Line 221 protected: |
| } | } |
| inline void expand() { | inline void expand() { |
| resize(fallocated>0 ? fallocated+fallocated/4+2 : 3); // 3 is PAF default, confirmed by tests | resize(fallocated>0 ? fallocated+fallocated/2+2 : 3); // 3 is PAF default, confirmed by tests |
| } | } |
| inline void fit(size_t index){ | inline void fit(size_t index){ |
| Line 259 template<typename T> char* pa_itoa(T n, | Line 259 template<typename T> char* pa_itoa(T n, |
| } | } |
| do { | do { |
| *(--pos)=(n % base) + '0'; | *(--pos)=(char)(n % base) + '0'; |
| n/=base; | n/=base; |
| } while (n > 0); | } while (n > 0); |
| Line 275 template<typename T> char* pa_uitoa(T n, | Line 275 template<typename T> char* pa_uitoa(T n, |
| *pos='\0'; | *pos='\0'; |
| do { | do { |
| *(--pos)=(n % base) + '0'; | *(--pos)=(char)(n % base) + '0'; |
| n/=base; | n/=base; |
| } while (n > 0); | } while (n > 0); |