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

Unified Diff: chrome/browser/metrics/android_metrics_provider.cc

Issue 2838893002: Remove base::ListValue::Set(size_t, base::Value*) (Closed)
Patch Set: Fix Compilation Error Created 3 years, 8 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
« no previous file with comments | « base/values.cc ('k') | chrome/browser/speech/extension_api/tts_extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/android_metrics_provider.cc
diff --git a/chrome/browser/metrics/android_metrics_provider.cc b/chrome/browser/metrics/android_metrics_provider.cc
index c7f89e1f368d9c8ab42f1fed5ac11596193c953c..79847f4c9b7d58d2c6efc39178a69c3daaf5154b 100644
--- a/chrome/browser/metrics/android_metrics_provider.cc
+++ b/chrome/browser/metrics/android_metrics_provider.cc
@@ -16,10 +16,8 @@
namespace {
// Increments a particular entry in the ListValue.
-void IncrementListValue(base::ListValue* counts, int index) {
- int current_count = 0;
- counts->GetInteger(index, &current_count);
- counts->Set(index, new base::Value(current_count + 1));
+void IncrementListValue(base::Value* counts, int index) {
+ counts->GetList()[index] = base::Value(counts->GetList()[index].GetInt() + 1);
}
// Takes an int corresponding to a Type and returns the corresponding flag.
« no previous file with comments | « base/values.cc ('k') | chrome/browser/speech/extension_api/tts_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698