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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBKey.h

Issue 2635403002: IndexedDB: Replace O(n^2) algorithm computing multientry index keys (Closed)
Patch Set: add comment about hashtable Created 3 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 | third_party/WebKit/Source/modules/indexeddb/IDBKey.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/indexeddb/IDBKey.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBKey.h b/third_party/WebKit/Source/modules/indexeddb/IDBKey.h
index cbbf32c3dac8ffbf69dcfd5961744206b8f61e62..4b9ff354ec8b6fc7d97572886c98e97731d8848e 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBKey.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBKey.h
@@ -55,29 +55,6 @@ class MODULES_EXPORT IDBKey : public GarbageCollectedFinalized<IDBKey> {
static IDBKey* createDate(double date) { return new IDBKey(DateType, date); }
- static IDBKey* createMultiEntryArray(const KeyArray& array) {
- KeyArray result;
-
- for (size_t i = 0; i < array.size(); i++) {
- if (!array[i]->isValid())
- continue;
-
- bool skip = false;
- for (size_t j = 0; j < result.size(); j++) {
- if (array[i]->isEqual(result[j].get())) {
- skip = true;
- break;
- }
- }
- if (!skip) {
- result.push_back(array[i]);
- }
- }
- IDBKey* idbKey = new IDBKey(result);
- ASSERT(idbKey->isValid());
- return idbKey;
- }
-
static IDBKey* createArray(const KeyArray& array) {
return new IDBKey(array);
}
@@ -128,6 +105,9 @@ class MODULES_EXPORT IDBKey : public GarbageCollectedFinalized<IDBKey> {
bool isLessThan(const IDBKey* other) const;
bool isEqual(const IDBKey* other) const;
+ // Returns a new key array with invalid keys and duplicates removed.
+ KeyArray toMultiEntryArray() const;
+
private:
IDBKey() : m_type(InvalidType) {}
IDBKey(Type type, double number) : m_type(type), m_number(number) {}
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/indexeddb/IDBKey.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698