Lines Matching refs:that

2 // Use of this source code is governed by a BSD-style license that can be
103 template <class S> static Unique<T> cast(Unique<S> that) {
104 return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_));
183 bool Equals(const UniqueSet<T>* that) const {
184 if (that->size_ != this->size_) return false;
186 if (this->array_[i] != that->array_[i]) return false;
204 // Check if this set is a subset of the given set. O(|this| + |that|).
205 bool IsSubset(const UniqueSet<T>* that) const {
206 if (that->size_ < this->size_) return false;
211 if (sought == that->array_[j++]) break;
212 // Fail whenever there are more elements in {this} than {that}.
213 if ((this->size_ - i) > (that->size_ - j)) return false;
220 // O(|this| + |that|).
221 UniqueSet<T>* Intersect(const UniqueSet<T>* that, Zone* zone) const {
222 if (that->size_ == 0 || this->size_ == 0) return new(zone) UniqueSet<T>();
225 Min(this->size_, that->size_), zone);
228 while (i < this->size_ && j < that->size_) {
230 Unique<T> b = that->array_[j];
247 // O(|this| + |that|).
248 UniqueSet<T>* Union(const UniqueSet<T>* that, Zone* zone) const {
249 if (that->size_ == 0) return this->Copy(zone);
250 if (this->size_ == 0) return that->Copy(zone);
253 this->size_ + that->size_, zone);
256 while (i < this->size_ && j < that->size_) {
258 Unique<T> b = that->array_[j];
273 while (j < that->size_) out->array_[k++] = that->array_[j++];
280 // that set. O(|this| * |that|).
281 UniqueSet<T>* Subtract(const UniqueSet<T>* that, Zone* zone) const {
282 if (that->size_ == 0) return this->Copy(zone);
289 if (!that->Contains(cand)) {