Ignore:
Timestamp:
Jul 2, 2015, 4:51:32 PM (4 years ago)
Author:
nmedfort
Message:

Fix for SCX and updated property objects.

File:
1 edited

Legend:

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

    r4629 r4631  
    352352 * @param hi_codepoint
    353353 *
    354  * Return true if this UnicodeSet contains any code point(s) between lo_codepoint and hi_codepoint
    355  ** ------------------------------------------------------------------------------------------------------------- */
    356 bool UnicodeSet::intersects(const codepoint_t lo_codepoint, const codepoint_t hi_codepoint) const {
    357     quad_iterator qi = quad_begin() + lo_codepoint / QUAD_BITS;
    358     unsigned n = (hi_codepoint - lo_codepoint) / QUAD_BITS;
    359     while (n) {
    360         if (qi.type() != Empty) {
    361             return true;
    362         }
    363         const auto l = std::min<unsigned>(qi.length(), n);
    364         qi += l;
    365         n -= l;
    366     }
    367     // check the remaining portion of this quad
    368     unsigned r = (hi_codepoint - lo_codepoint) % QUAD_BITS;
    369     if (r == 0 || (++qi).type() == Empty) {
    370         return false;
    371     }
    372     if (qi.type() == Full) {
     354 * Return true if this UnicodeSet contains any code point(s) between lo and hi (inclusive)
     355 ** ------------------------------------------------------------------------------------------------------------- */
     356bool UnicodeSet::intersects(const codepoint_t lo, const codepoint_t hi) const {
     357    for (auto range : *this) {
     358        if (hi_codepoint(range) < lo) {
     359            continue;
     360        }
     361        if (lo_codepoint(range) > hi) {
     362            break;
     363        }
    373364        return true;
    374365    }
    375     return (qi.quad() & (FULL_QUAD_MASK << r)) != 0;
     366    return false;
    376367}
    377368
Note: See TracChangeset for help on using the changeset viewer.