Remove superfluous "has" function

This commit is contained in:
Eelco Dolstra 2015-11-02 14:29:12 +01:00
parent a5879cbeb8
commit c087472c71
3 changed files with 2 additions and 9 deletions

View file

@ -249,7 +249,7 @@ void getDependents(Step::ptr step, std::set<Build::ptr> & builds, std::set<Step:
std::function<void(Step::ptr)> visit;
visit = [&](Step::ptr step) {
if (has(steps, step)) return;
if (steps.count(step)) return;
steps.insert(step);
std::vector<Step::wptr> rdeps;

View file

@ -89,7 +89,7 @@ bool State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store,
BuildID id = row["id"].as<BuildID>();
if (buildOne && id != buildOne) continue;
if (id > newLastBuildId) newLastBuildId = id;
if (has(*builds_, id)) continue;
if (builds_->count(id)) continue;
auto build = std::make_shared<Build>();
build->id = id;

View file

@ -439,10 +439,3 @@ public:
void run(BuildID buildOne = 0);
};
template <class C, class V>
bool has(const C & c, const V & v)
{
return c.find(v) != c.end();
}