Ignore:
Timestamp:
Dec 15, 2017, 9:19:27 AM (22 months ago)
Author:
cameron
Message:

Small fixes

Location:
icGREP/icgrep-devel/icgrep/UCD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/CaseFolding.cpp

    r5770 r5781  
    2727}
    2828
    29 void caseInsensitiveInsertRange(UnicodeSet * const cc, const codepoint_t lo, const codepoint_t hi) {
    30     cc->insert_range(lo, hi);
     29void caseInsensitiveInsertRange(UnicodeSet & cc, const codepoint_t lo, const codepoint_t hi) {
     30    cc.insert_range(lo, hi);
    3131    // Find the first foldTable entry overlapping the (lo, hi) range.
    3232    int e = findFoldEntry(lo);
     
    5050            if ((lo1 <= negative_subrange_hi) && (hi1 >= negative_subrange_lo)) {
    5151                // negative offsets apply
    52                 cc->insert_range(std::max(negative_subrange_lo,lo1) - fe.fold_offset, std::min(negative_subrange_hi, hi1) - fe.fold_offset);
     52                cc.insert_range(std::max(negative_subrange_lo,lo1) - fe.fold_offset, std::min(negative_subrange_hi, hi1) - fe.fold_offset);
    5353            }
    5454            // Now the positive offset subrange.
     
    5656            codepoint_t positive_subrange_hi = positive_subrange_lo + fe.fold_offset - 1;
    5757            if ((lo1 <= positive_subrange_hi) && (hi1 >= positive_subrange_lo)) {
    58                 cc->insert_range(std::max(positive_subrange_lo, lo1) + fe.fold_offset, std::min(positive_subrange_hi, hi1) + fe.fold_offset);
     58                cc.insert_range(std::max(positive_subrange_lo, lo1) + fe.fold_offset, std::min(positive_subrange_hi, hi1) + fe.fold_offset);
    5959            }
    6060        }
     
    6262            // We have either a positive or negative offset, and all offsets for
    6363            // this entry have the same sign.
    64             cc->insert_range(lo1 + fe.fold_offset, hi1 + fe.fold_offset);
     64            cc.insert_range(lo1 + fe.fold_offset, hi1 + fe.fold_offset);
    6565        }
    6666        // Now pick up any individual fold entries.
     
    6868            if (fe.fold_pairs[i].first < lo) continue;  // Only possible for first fold_entry.
    6969            if (fe.fold_pairs[i].first > hi) break;     // Only possible for last fold_entry.
    70             cc->insert(fe.fold_pairs[i].second);
     70            cc.insert(fe.fold_pairs[i].second);
    7171        }
    7272        // Move on to the next fold_entry.
     
    8282}
    8383
    84 UnicodeSet * caseInsensitize(UnicodeSet * const cc) {
    85     UnicodeSet * cci = new UnicodeSet();
    86     for (const interval_t i : *cc) {
     84UnicodeSet caseInsensitize(UnicodeSet & cc) {
     85    UnicodeSet cci;
     86    for (const interval_t i : cc) {
    8787        caseInsensitiveInsertRange(cci, lo_codepoint(i), hi_codepoint(i));
    8888    }
  • icGREP/icgrep-devel/icgrep/UCD/CaseFolding.h

    r5770 r5781  
    2121};
    2222
    23 UCD::UnicodeSet * caseInsensitize(UCD::UnicodeSet * const cc);
     23UCD::UnicodeSet caseInsensitize(UCD::UnicodeSet & cc);
    2424
    2525
Note: See TracChangeset for help on using the changeset viewer.