| 137 | } |
| 138 | |
| 139 | forceinline void |
| 140 | BndSet::update(Space& home, BndSet& d) { |
| 141 | if (d.fst() == fst()) |
| 142 | return; |
| 143 | if (fst() != nullptr) |
| 144 | fst()->dispose(home,lst()); |
| 145 | _size = d.size(); |
| 146 | if (_size == 0) { |
| 147 | fst(nullptr); lst(nullptr); |
| 148 | return; |
| 149 | } |
| 150 | |
| 151 | int n=0; |
| 152 | for (RangeList* c = d.fst(); c != nullptr; c = c->next()) |
| 153 | n++; |
| 154 | |
| 155 | RangeList* r = home.alloc<RangeList>(n); |
| 156 | fst(r); lst(r+n-1); |
| 157 | |
| 158 | { |
| 159 | RangeList* c = d.fst(); |
| 160 | for (int i=0; i<n; i++) { |
| 161 | r[i].min(c->min()); |
| 162 | r[i].max(c->max()); |
| 163 | r[i].next(&r[i+1]); |
| 164 | c = c->next(); |
| 165 | } |
| 166 | } |
| 167 | r[n-1].next(nullptr); |
| 168 | } |
| 169 | |
| 170 | template<class I> forceinline bool |
| 171 | BndSet::overwrite(Space& home, I& ri) { |