- File:
-
- 1 edited
-
libcfa/src/collections/string_res.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string_res.cfa
r9018dcf red5023d1 10 10 // Created On : Fri Sep 03 11:00:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 9 08:44:17202513 // Update Count : 1 2812 // Last Modified On : Sun Apr 6 07:38:02 2025 13 // Update Count : 111 14 14 // 15 15 … … 190 190 const char * DEBUG_string_heap_start( VbyteHeap * heap ) { 191 191 return heap->StartVbyte; 192 } 193 194 // Returns the size of the string in bytes 195 size_t len(const string_res & s) with(s) { 196 return Handle.lnth; 192 197 } 193 198 … … 751 756 } 752 757 753 // int find$( const string_res & s, ssize_t start, ssize_t len, const string_res & k, ssize_t kstart, ssize_t klen ) { 754 // if ( start < 0 ) start = s.Handle.lnth + start; // adjust negative starting locations 755 // if ( kstart < 0 ) kstart = k.Handle.lnth + kstart; 756 757 // if ( start + len > s.Handle.lnth ) return start + 1; // cannot be there 758 // if ( kstart + len > k.Handle.lnth ) return start + 1; 759 // if ( klen > len ) return start + 1; 760 761 // int i, r; 762 763 // for ( i = max( start, 1 ); ; i += 1 ) { 764 // if ( i > s.Handle.lnth - k.Handle.lnth + 1 ) { 765 // r = s.Handle.lnth + 1; 766 // break; 767 // } // exit 768 // if ( HeapArea->ByteCmp( s.Handle.s, i, k.Handle.lnth, k.Handle.s, 1, k.Handle.lnth ) == 0 ) { 769 // r = i; 770 // break; 771 // } // exit 772 // } // for 773 // return r; 774 // } 775 776 int find( const string_res & s, char search ) { 758 int find(const string_res & s, char search) { 777 759 return findFrom(s, 0, search); 778 760 } 779 761 780 int findFrom( const string_res & s, size_t fromPos, char search) {762 int findFrom(const string_res & s, size_t fromPos, char search) { 781 763 // FIXME: This paricular overload (find of single char) is optimized to use memchr. 782 764 // The general overload (find of string, memchr applying to its first character) and `contains` should be adjusted to match.
Note:
See TracChangeset
for help on using the changeset viewer.