From 9ddd54d16d19dedcfcd0020f47d089c587775eb9 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 10 Jun 2016 06:41:20 -0400 Subject: [PATCH] Avoid copy of work list argument: make it const ref --- source/validate_cfg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/validate_cfg.cpp b/source/validate_cfg.cpp index ef41db0..136cbdc 100644 --- a/source/validate_cfg.cpp +++ b/source/validate_cfg.cpp @@ -74,8 +74,8 @@ struct block_info { /// @param[in] id The ID of the block being checked /// @return true if the edge work_list.back().block->get_id() => id is a /// back-edge -bool FindInWorkList(vector work_list, uint32_t id) { - for (auto b : work_list) { +bool FindInWorkList(const vector& work_list, uint32_t id) { + for (const auto b : work_list) { if (b.block->get_id() == id) return true; } return false; -- 2.7.4