Bug 1565515 - Move sortKey variable declaration close to usage r=ttung,asuth

Differential Revision: https://phabricator.services.mozilla.com/D38075

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Simon Giesecke 2019-07-29 09:26:27 +00:00
Родитель 1fef183353
Коммит fd2c92c543
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -505,8 +505,6 @@ void IDBCursor::ContinuePrimaryKey(JSContext* aCx, JS::Handle<JS::Value> aKey,
key = tmp;
}
const Key& sortKey = IsLocaleAware() ? mSortKey : mKey;
if (key.IsUnset()) {
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
return;
@ -526,6 +524,8 @@ void IDBCursor::ContinuePrimaryKey(JSContext* aCx, JS::Handle<JS::Value> aKey,
return;
}
const Key& sortKey = IsLocaleAware() ? mSortKey : mKey;
switch (mDirection) {
case NEXT:
if (key < sortKey || (key == sortKey && primaryKey <= mPrimaryKey)) {