Lines Matching refs:ranges
183 void addSortedRange(Vector<CharacterRange>& ranges, UChar lo, UChar hi)
185 unsigned end = ranges.size();
187 // Simple linear scan - I doubt there are that many ranges anyway...
191 if (hi < ranges[i].begin) {
192 // optional optimization: concatenate appending ranges? - may not be worthwhile.
193 if (hi == (ranges[i].begin - 1)) {
194 ranges[i].begin = lo;
197 ranges.insert(i, CharacterRange(lo, hi));
203 if (lo <= (ranges[i].end + 1)) {
205 ranges[i].begin = std::min(ranges[i].begin, lo);
206 ranges[i].end = std::max(ranges[i].end, hi);
208 // now check if the new range can subsume any subsequent ranges.
211 while (next < ranges.size()) {
212 if (ranges[next].begin <= (ranges[i].end + 1)) {
214 ranges[i].end = std::max(ranges[i].end, ranges[next].end);
215 ranges.remove(next);
224 // CharacterRange comes after all existing ranges.
225 ranges.append(CharacterRange(lo, hi));