Lines Matching full:that
2 // Use of this source code is governed by a BSD-style license that can be
106 template <class S> static Unique<T> cast(Unique<S> that) {
111 return Unique<T>(that.raw_address_,
112 Handle<T>(reinterpret_cast<T**>(that.handle_.location())));
197 bool Equals(const UniqueSet<T>* that) const {
198 if (that->size_ != this->size_) return false;
200 if (this->array_[i] != that->array_[i]) return false;
218 // Check if this set is a subset of the given set. O(|this| + |that|).
219 bool IsSubset(const UniqueSet<T>* that) const {
220 if (that->size_ < this->size_) return false;
225 if (sought == that->array_[j++]) break;
226 // Fail whenever there are more elements in {this} than {that}.
227 if ((this->size_ - i) > (that->size_ - j)) return false;
234 // O(|this| + |that|).
235 UniqueSet<T>* Intersect(const UniqueSet<T>* that, Zone* zone) const {
236 if (that->size_ == 0 || this->size_ == 0) return new(zone) UniqueSet<T>();
239 Min(this->size_, that->size_), zone);
242 while (i < this->size_ && j < that->size_) {
244 Unique<T> b = that->array_[j];
261 // O(|this| + |that|).
262 UniqueSet<T>* Union(const UniqueSet<T>* that, Zone* zone) const {
263 if (that->size_ == 0) return this->Copy(zone);
264 if (this->size_ == 0) return that->Copy(zone);
267 this->size_ + that->size_, zone);
270 while (i < this->size_ && j < that->size_) {
272 Unique<T> b = that->array_[j];
287 while (j < that->size_) out->array_[k++] = that->array_[j++];
294 // that set. O(|this| * |that|).
295 UniqueSet<T>* Subtract(const UniqueSet<T>* that, Zone* zone) const {
296 if (that->size_ == 0) return this->Copy(zone);
303 if (!that->Contains(cand)) {