-#include <algorithm>
+#include <msp/core/algorithm.h>
#include <msp/io/print.h>
#include <msp/strings/utils.h>
#include "binarypackage.h"
Flags exclusive_static_flags;
for(const string &f: static_flags)
- if(find(flags.begin(), flags.end(), f)==flags.end())
+ if(!any_equals(flags, f))
exclusive_static_flags.push_back(f);
process_flags(exclusive_static_flags, pkg->static_binfo);
for(Package *r: all_reqs)
{
BuildInfo::UpdateLevel level = BuildInfo::CHAINED;
- if(find(direct_reqs.begin(), direct_reqs.end(), r)!=direct_reqs.end())
+ if(any_equals(direct_reqs, r))
level = BuildInfo::DEPENDENCY;
final_build_info.update_from(r->get_exported_build_info(), level);
for(Package *q: r->get_required_packages())
- if(find(all_reqs.begin(), all_reqs.end(), q)==all_reqs.end())
+ if(!any_equals(all_reqs, q))
all_reqs.push_back(q);
}
}
for(Target *d: deps_to_add)
- if(find(depends.begin(), depends.end(), d)==depends.end())
+ if(!any_equals(depends, d))
{
add_dependency(*d);
if(d->get_real_target()->is_buildable())
-#include <algorithm>
+#include <msp/core/algorithm.h>
#include "builder.h"
#include "file.h"
#include "sourcearchivecomponent.h"
BuildGraph &build_graph = builder.get_build_graph();
for(const auto &kvp: build_graph.get_targets())
if(kvp.second->get_package()==&package && !kvp.second->is_buildable())
- if(find(files.begin(), files.end(), kvp.second)==files.end())
+ if(!any_equals(files, kvp.second))
files.push_back(kvp.second);
const Toolchain &toolchain = builder.get_toolchain();
{
/* Make sure the source tarball is last in the list so targets from all
other components wil be created first */
- ComponentList::iterator i = find(obj.components.begin(), obj.components.end(), obj.source_archive);
+ ComponentList::iterator i = find(obj.components, obj.source_archive);
if(i!=obj.components.end())
obj.components.splice(obj.components.end(), obj.components, i);
}
-#include <algorithm>
+#include <msp/core/algorithm.h>
#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include <msp/strings/format.h>
for(Target *d: depends)
{
// Avoid infinite recursion if a target repends on its own side effect
- if(find(side_effects.begin(), side_effects.end(), d)!=side_effects.end())
+ if(any_equals(side_effects, d))
continue;
Target *tgt = d->get_buildable_target();
-#include <algorithm>
+#include <msp/core/algorithm.h>
#include <msp/strings/format.h>
#include "architecture.h"
#include "builder.h"
bool Tool::accepts_suffix(const string &suffix, bool aux) const
{
- if(find(input_suffixes.begin(), input_suffixes.end(), suffix)!=input_suffixes.end())
- return true;
- else if(aux)
- return find(aux_suffixes.begin(), aux_suffixes.end(), suffix)!=aux_suffixes.end();
- else
- return false;
+ return (any_equals(input_suffixes, suffix) || (aux && any_equals(aux_suffixes, suffix)));
}
Target *Tool::create_target(Target &source, const string &arg)
add_dependency(*project);
for(Package *r: spkg->get_required_packages())
- if(find(reqs, r)==reqs.end())
+ if(!any_equals(reqs, r))
reqs.push_back(r);
}
}