| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TOOLS_GN_UNIQUE_VECTOR_H_ | 5 #ifndef TOOLS_GN_UNIQUE_VECTOR_H_ |
| 6 #define TOOLS_GN_UNIQUE_VECTOR_H_ | 6 #define TOOLS_GN_UNIQUE_VECTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include <algorithm> | 10 #include <algorithm> |
| 9 | 11 |
| 10 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 11 | 13 |
| 12 namespace internal { | 14 namespace internal { |
| 13 | 15 |
| 14 // This lass allows us to insert things by reference into a hash table which | 16 // This lass allows us to insert things by reference into a hash table which |
| 15 // avoids copies. The hash function of a UniquifyRef is that of the object it | 17 // avoids copies. The hash function of a UniquifyRef is that of the object it |
| 16 // points to. | 18 // points to. |
| 17 // | 19 // |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 169 |
| 168 private: | 170 private: |
| 169 typedef internal::UniquifyRef<T> Ref; | 171 typedef internal::UniquifyRef<T> Ref; |
| 170 typedef base::hash_set<Ref> HashSet; | 172 typedef base::hash_set<Ref> HashSet; |
| 171 | 173 |
| 172 HashSet set_; | 174 HashSet set_; |
| 173 Vector vector_; | 175 Vector vector_; |
| 174 }; | 176 }; |
| 175 | 177 |
| 176 #endif // TOOLS_GN_UNIQUE_VECTOR_H_ | 178 #endif // TOOLS_GN_UNIQUE_VECTOR_H_ |
| OLD | NEW |