Ignore:
Timestamp:
May 8, 2026, 7:52:34 AM (6 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
bc547d3
Parents:
d8a2f98
Message:

remove string 'contains' function and replace with 'includes', make string 'includes' inline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string_res.cfa

    rd8a2f98 r2f16569  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 14 20:45:39 2025
    13 // Update Count     : 130
     12// Last Modified On : Thu May  7 13:14:45 2026
     13// Update Count     : 135
    1414//
    1515
     
    750750// Search
    751751
    752 bool contains(const string_res & s, char ch) {
    753         for ( i; len(s) ) {
    754                 if (s[i] == ch) return true;
    755         }
    756         return false;
    757 }
    758 
    759752// int find$( const string_res & s, ssize_t start, ssize_t len, const string_res & k, ssize_t kstart, ssize_t klen ) {
    760753//     if ( start < 0 ) start = s.Handle.lnth + start;          // adjust negative starting locations
     
    917910static bool test( const charclass_res & mask, char c ) {
    918911        // instead, use sorted char list?
    919         return contains( mask.chars, c );
     912        for ( i; len(mask.chars) ) {
     913                if (mask.chars[i] == c) return true;
     914        }
     915        return false;
     916//      return contains( mask.chars, c );
    920917}
    921918
Note: See TracChangeset for help on using the changeset viewer.