Use std::any_of rather than std::find_if() != end()

This commit is contained in:
Thomas Goyne 2012-11-13 05:52:24 -08:00
parent b6b68b789d
commit 653aa32eb2
2 changed files with 3 additions and 3 deletions

View File

@ -570,8 +570,8 @@ namespace Automation4 {
{ {
using std::placeholders::_1; using std::placeholders::_1;
// Just make this always return true to bitch about unknown script formats in autoload // Just make this always return true to bitch about unknown script formats in autoload
return find_if(Factories().begin(), Factories().end(), return any_of(Factories().begin(), Factories().end(),
[&](ScriptFactory *sf) { return filename.Matches(sf->GetFilenamePattern()); }) != Factories().end(); [&](ScriptFactory *sf) { return filename.Matches(sf->GetFilenamePattern()); });
} }
std::vector<ScriptFactory*>& ScriptFactory::Factories() std::vector<ScriptFactory*>& ScriptFactory::Factories()

View File

@ -612,7 +612,7 @@ static void duplicate_lines(agi::Context *c, bool shift) {
if (start == end) break; if (start == end) break;
// And the last line in this contiguous selection // And the last line in this contiguous selection
entryIter insert_pos = find_if(start, end, std::not1(sel)); entryIter insert_pos = find_if_not(start, end, sel);
entryIter last = insert_pos; entryIter last = insert_pos;
--last; --last;