aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Fourchan.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index e65835a..06728fe 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -552,11 +552,11 @@ namespace QuickMedia {
BodyItems Fourchan::get_related_media(const std::string &url) {
BodyItems body_items;
- auto it = cached_media_urls.begin();
- for(; it != cached_media_urls.end(); ++it) {
- if(url == *it)
- break;
- }
+ auto it = std::find(cached_media_urls.begin(), cached_media_urls.end(), url);
+ if(it == cached_media_urls.end())
+ return body_items;
+
+ ++it;
for(; it != cached_media_urls.end(); ++it) {
auto body_item = std::make_unique<BodyItem>("");
body_item->url = *it;