Skip to content

Commit ea72c21

Browse files
committed
Remove .find usage
1 parent 28d71d8 commit ea72c21

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

App Store.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,15 @@ function preloadCategoryFiles() {
426426
var categoryLastUpdated = category.lastUpdated || 0;
427427

428428
// Find stored timestamp for this category
429-
var timestampEntry = storedTimestamps.find(function(entry) {
430-
return entry.slug === category.slug;
431-
});
432-
var storedLastUpdated = timestampEntry ? (timestampEntry.lastUpdated || 0) : 0;
433-
var timestampIndex = timestampEntry ? storedTimestamps.indexOf(timestampEntry) : -1;
429+
var storedLastUpdated = 0;
430+
var timestampIndex = -1;
431+
for (var t = 0; t < storedTimestamps.length; t++) {
432+
if (storedTimestamps[t].slug === category.slug) {
433+
storedLastUpdated = storedTimestamps[t].lastUpdated || 0;
434+
timestampIndex = t;
435+
break;
436+
}
437+
}
434438

435439
// Check if cache file needs to be updated
436440
var needsDownload = categoryLastUpdated > storedLastUpdated;

0 commit comments

Comments
 (0)