From 142c9abbaab3d382d86e3e8e3887533f9b04469e Mon Sep 17 00:00:00 2001 From: William Woodall Date: Thu, 29 Oct 2015 15:35:32 -0700 Subject: [PATCH] Fix windows vector issue --- .../strategies/allocator_memory_strategy.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp index 61d612d..7622123 100644 --- a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp +++ b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp @@ -113,27 +113,27 @@ public: { { VectorRebind temp; - for (size_t i = 0; i < subscriptions_.size() * 2; i++) { - if (subscriber_handles_[i]) { - temp.push_back(subscriber_handles_[i]); + for (auto & subscriber_handle : subscriber_handles_) { + if (subscriber_handle) { + temp.push_back(subscriber_handle); } } subscriber_handles_.swap(temp); } { VectorRebind temp; - for (size_t i = 0; i < services_.size(); i++) { - if (service_handles_[i]) { - temp.push_back(service_handles_[i]); + for (auto & service_handle : service_handles_) { + if (service_handle) { + temp.push_back(service_handle); } } service_handles_.swap(temp); } { VectorRebind temp; - for (size_t i = 0; i < clients_.size(); i++) { - if (client_handles_[i]) { - temp.push_back(client_handles_[i]); + for (auto & client_handle : client_handles_) { + if (client_handle) { + temp.push_back(client_handle); } } client_handles_.swap(temp);