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

Unified Diff: content/common/indexed_db/indexed_db_key.cc

Issue 9104026: Iterate an array in O(n) rather than O(n^2) time during IDBKey conversion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/indexed_db_key.cc
diff --git a/content/common/indexed_db/indexed_db_key.cc b/content/common/indexed_db/indexed_db_key.cc
index f2a7cfbb7930b12f47237a7f50d692f925077da6..e55e582dcd1e6e0b2c6fa5d73adbf6120153a58e 100644
--- a/content/common/indexed_db/indexed_db_key.cc
+++ b/content/common/indexed_db/indexed_db_key.cc
@@ -9,6 +9,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
using WebKit::WebIDBKey;
+using WebKit::WebVector;
IndexedDBKey::IndexedDBKey()
: type_(WebIDBKey::NullType),
@@ -55,8 +56,9 @@ void IndexedDBKey::Set(const WebIDBKey& key) {
type_ = key.type();
array_.clear();
if (key.type() == WebIDBKey::ArrayType) {
- for (size_t i = 0; i < key.array().size(); ++i) {
- array_.push_back(IndexedDBKey(key.array()[i]));
+ WebVector<WebIDBKey> array = key.array();
+ for (size_t i = 0; i < array.size(); ++i) {
+ array_.push_back(IndexedDBKey(array[i]));
}
}
string_ = key.type() == WebIDBKey::StringType ?
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698