Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: tools/gn/unique_vector.h

Issue 964203002: tools/gn: Fix errors found by Facebook's flint tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromium-style plugin errors Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/tutorial/hello.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 8 #include <algorithm>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 15 matching lines...) Expand all
26 class UniquifyRef { 26 class UniquifyRef {
27 public: 27 public:
28 UniquifyRef() 28 UniquifyRef()
29 : value_(nullptr), 29 : value_(nullptr),
30 vect_(nullptr), 30 vect_(nullptr),
31 index_(static_cast<size_t>(-1)), 31 index_(static_cast<size_t>(-1)),
32 hash_val_(0) { 32 hash_val_(0) {
33 } 33 }
34 34
35 // Initialize with a pointer to a value. 35 // Initialize with a pointer to a value.
36 UniquifyRef(const T* v) 36 explicit UniquifyRef(const T* v)
37 : value_(v), 37 : value_(v),
38 vect_(nullptr), 38 vect_(nullptr),
39 index_(static_cast<size_t>(-1)) { 39 index_(static_cast<size_t>(-1)) {
40 FillHashValue(); 40 FillHashValue();
41 } 41 }
42 42
43 // Initialize with an array + index. 43 // Initialize with an array + index.
44 UniquifyRef(const std::vector<T>* v, size_t i) 44 UniquifyRef(const std::vector<T>* v, size_t i)
45 : value_(nullptr), 45 : value_(nullptr),
46 vect_(v), 46 vect_(v),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 private: 168 private:
169 typedef internal::UniquifyRef<T> Ref; 169 typedef internal::UniquifyRef<T> Ref;
170 typedef base::hash_set<Ref> HashSet; 170 typedef base::hash_set<Ref> HashSet;
171 171
172 HashSet set_; 172 HashSet set_;
173 Vector vector_; 173 Vector vector_;
174 }; 174 };
175 175
176 #endif // TOOLS_GN_UNIQUE_VECTOR_H_ 176 #endif // TOOLS_GN_UNIQUE_VECTOR_H_
OLDNEW
« no previous file with comments | « tools/gn/tutorial/hello.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698