Replace for-loop with std::any_of.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
51673c7f2a
commit
bc2364875d
|
@ -35,6 +35,7 @@ namespace mastorss
|
||||||
{
|
{
|
||||||
using boost::regex;
|
using boost::regex;
|
||||||
using boost::regex_replace;
|
using boost::regex_replace;
|
||||||
|
using std::any_of;
|
||||||
using std::transform;
|
using std::transform;
|
||||||
using std::ifstream;
|
using std::ifstream;
|
||||||
using std::istringstream;
|
using std::istringstream;
|
||||||
|
@ -162,17 +163,10 @@ void Document::parse_rss(const pt::ptree &tree)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool skipthis{false};
|
|
||||||
string title{rssitem.get<string>("title")};
|
string title{rssitem.get<string>("title")};
|
||||||
for (const auto &skip : _profiledata.skip)
|
if (any_of(_profiledata.skip.begin(), _profiledata.skip.end(),
|
||||||
{
|
[&title](const string &skip)
|
||||||
if (title.substr(0, skip.length()) == skip)
|
{ return title.substr(0, skip.size()) == skip; }))
|
||||||
{
|
|
||||||
skipthis = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (skipthis)
|
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Skipped GUID: " << guid;
|
BOOST_LOG_TRIVIAL(debug) << "Skipped GUID: " << guid;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user