Skip to content

Commit

Permalink
Optimize codes
Browse files Browse the repository at this point in the history
Signed-off-by: Barry Xu <barry.xu@sony.com>
  • Loading branch information
Barry-Xu-2018 committed Feb 23, 2023
1 parent 3eaf60a commit e00bfd2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <memory>
#include <vector>
#include <utility>

#include "rcl/allocator.h"

Expand Down Expand Up @@ -121,9 +122,10 @@ class AllocatorMemoryStrategy : public memory_strategy::MemoryStrategy
}
for (size_t i = 0; i < waitable_handles_.size(); ++i) {
if (waitable_handles_[i]->is_ready(wait_set)) {
waitable_triggered_handles_.emplace_back(waitable_handles_[i]);
waitable_triggered_handles_.emplace_back(std::move(waitable_handles_[i]));
}
}
waitable_handles_.clear();

subscription_handles_.erase(
std::remove(subscription_handles_.begin(), subscription_handles_.end(), nullptr),
Expand All @@ -144,8 +146,6 @@ class AllocatorMemoryStrategy : public memory_strategy::MemoryStrategy
std::remove(timer_handles_.begin(), timer_handles_.end(), nullptr),
timer_handles_.end()
);

waitable_handles_.clear();
}

bool collect_entities(const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
Expand Down

0 comments on commit e00bfd2

Please sign in to comment.