diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-05-29 14:55:51 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-09 22:15:32 +0200 |
commit | b74bd9e24e1205b7449404fd05172664b211d82c (patch) | |
tree | af69d4efbdddee347cd82c774880efa6820a0aa2 /src/task.cc | |
parent | 15eea63a6e7da37e7b4d643f189e6de150268ff8 (diff) |
Make all task lists std::set instead of std::list to make sure to not contain duplicates.
Diffstat (limited to 'src/task.cc')
-rw-r--r-- | src/task.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/task.cc b/src/task.cc index 8a9eefa..b8fce06 100644 --- a/src/task.cc +++ b/src/task.cc @@ -12,7 +12,7 @@ Task::Task(const BuildConfiguration& config) { } -int Task::registerDepTasks(const std::list<std::shared_ptr<Task>>& tasks) +int Task::registerDepTasks(const std::set<std::shared_ptr<Task>>& tasks) { for(const auto& depStr : depends()) { @@ -21,7 +21,7 @@ int Task::registerDepTasks(const std::list<std::shared_ptr<Task>>& tasks) { if(task->target() == depStr) { - dependsTasks.push_back(task); + dependsTasks.insert(task); found = true; } } @@ -146,7 +146,7 @@ std::string Task::compiler() const } } -std::list<std::shared_ptr<Task>> Task::getDependsTasks() +std::set<std::shared_ptr<Task>> Task::getDependsTasks() { return dependsTasks; } |