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

Unified Diff: gpu/config/gpu_control_list.cc

Issue 2424733002: Add unittest to avoid duplicate id in gpu driver bug list (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: gpu/config/gpu_control_list.cc
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index 98d5409a25b498a5f0aa6c855cbac7751989d6b5..762a1c523de2b53d9c613be5e1581313d97c057d 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -1580,6 +1580,17 @@ size_t GpuControlList::num_entries() const {
return entries_.size();
}
+bool GpuControlList::has_duplicate_entry_id() const {
+ std::set<int> ids;
+ for (size_t i = 0; i < entries_.size(); ++i) {
+ if (ids.count(entries_[i]->id()) == 0)
+ ids.insert(entries_[i]->id());
+ else
+ return true;
+ }
+ return false;
+}
+
uint32_t GpuControlList::max_entry_id() const {
return max_entry_id_;
}

Powered by Google App Engine
This is Rietveld 408576698