Skip to content

Commit

Permalink
perf(posts): Don't waste time sorting photos we're caching.
Browse files Browse the repository at this point in the history
  • Loading branch information
randytarampi committed Aug 18, 2018
1 parent d8a8ffe commit 3d5bf96
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions packages/posts/photos/cachePhotos.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from "lodash";
import logger from "../lib/logger";
import {initializePhotoSources} from "./photoSources";

Expand All @@ -14,12 +13,6 @@ const cachePhotos = photoSearchParams => {
});
})
);
})
.then(_.flatten)
.then(flattenedPhotos => {
return _.sortBy(flattenedPhotos, [
post => -1 * (post.dateCreated ? post.dateCreated.valueOf() : post.datePublished ? post.datePublished.valueOf() : 0)
]);
});
};

Expand Down
7 changes: 0 additions & 7 deletions packages/posts/words/cacheWords.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from "lodash";
import logger from "../lib/logger";
import {initializeWordSources} from "./wordSources";

Expand All @@ -14,12 +13,6 @@ const cacheWords = wordSearchParams => {
});
})
);
})
.then(_.flatten)
.then(flattenedWords => {
return _.sortBy(flattenedWords, [
post => -1 * (post.dateCreated ? post.dateCreated.valueOf() : post.datePublished ? post.datePublished.valueOf() : 0)
]);
});
};

Expand Down

0 comments on commit 3d5bf96

Please sign in to comment.