Changeset 9018dcf for libcfa/src/collections/string_res.cfa
- Timestamp:
- Apr 10, 2025, 7:33:31 AM (9 months ago)
- Branches:
- master
- Children:
- 7e4f226
- Parents:
- 931f1b4
- File:
-
- 1 edited
-
libcfa/src/collections/string_res.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string_res.cfa
r931f1b4 r9018dcf 10 10 // Created On : Fri Sep 03 11:00:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Apr 6 07:38:02202513 // Update Count : 1 1112 // Last Modified On : Wed Apr 9 08:44:17 2025 13 // Update Count : 128 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 bytes195 size_t len(const string_res & s) with(s) {196 return Handle.lnth;197 192 } 198 193 … … 756 751 } 757 752 758 int find(const string_res & s, char search) { 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 ) { 759 777 return findFrom(s, 0, search); 760 778 } 761 779 762 int findFrom( const string_res & s, size_t fromPos, char search) {780 int findFrom( const string_res & s, size_t fromPos, char search ) { 763 781 // FIXME: This paricular overload (find of single char) is optimized to use memchr. 764 782 // 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.