From f2856ec8ba5416669a6540aa4319cff5db8c8a66 Mon Sep 17 00:00:00 2001 From: Leonard Ossa Date: Tue, 9 Jul 2024 14:31:35 +0200 Subject: [PATCH] Refactor exists method in AddrList to use std::find Signed-off-by: Leonard Ossa --- openvpn/addr/addrlist.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/openvpn/addr/addrlist.hpp b/openvpn/addr/addrlist.hpp index 30a59803..6f32044a 100644 --- a/openvpn/addr/addrlist.hpp +++ b/openvpn/addr/addrlist.hpp @@ -41,12 +41,7 @@ class AddrList : public std::vector, public RC bool exists(const IP::Addr &a) const { - for (const_iterator i = begin(); i != end(); ++i) - { - if (a == *i) - return true; - } - return false; + return std::find(begin(), end(), a) != end(); } #if 0