From c3382b9e18467128264eccc440c482d57123c657 Mon Sep 17 00:00:00 2001 From: Daniel Krebs Date: Tue, 13 Feb 2018 13:45:01 +0100 Subject: [PATCH] lib/card: pass string as const reference to lookupIp() --- fpga/include/villas/fpga/card.hpp | 2 +- fpga/lib/card.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fpga/include/villas/fpga/card.hpp b/fpga/include/villas/fpga/card.hpp index 20c89876d..4d838559c 100644 --- a/fpga/include/villas/fpga/card.hpp +++ b/fpga/include/villas/fpga/card.hpp @@ -75,7 +75,7 @@ public: bool reset() { return true; } void dump() { } - ip::IpCore* lookupIp(std::string name) const; + ip::IpCore* lookupIp(const std::string& name) const; ip::IpCoreList ips; ///< IPs located on this FPGA card diff --git a/fpga/lib/card.cpp b/fpga/lib/card.cpp index da0e2d830..b15328566 100644 --- a/fpga/lib/card.cpp +++ b/fpga/lib/card.cpp @@ -132,7 +132,8 @@ fpga::PCIeCardFactory::create() ip::IpCore* -PCIeCard::lookupIp(std::string name) const { +PCIeCard::lookupIp(const std::string& name) const +{ for(auto& ip : ips) { if(*ip == name) { return ip.get();