From: tho Date: Mon, 2 Aug 2010 13:41:15 +0000 (+0000) Subject: Socket/Protocols/Raw: optimized MACAddress - EUI64 comparison X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=96f5a2b7d3e893b4a6e043aef310aa652492b37f;p=senf.git Socket/Protocols/Raw: optimized MACAddress - EUI64 comparison git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1656 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/Protocols/Raw/MACAddress.cci b/senf/Socket/Protocols/Raw/MACAddress.cci index 5c73fe2..de96558 100644 --- a/senf/Socket/Protocols/Raw/MACAddress.cci +++ b/senf/Socket/Protocols/Raw/MACAddress.cci @@ -124,17 +124,13 @@ prefix_ boost::uint64_t senf::MACAddress::uint64() prefix_ bool senf::operator==(MACAddress const & mac, EUI64 const & eui64) { return eui64.isMACCompatible() - && eui64[0] == mac[0] - && eui64[1] == mac[1] - && eui64[2] == mac[2] - && eui64[5] == mac[3] - && eui64[6] == mac[4] - && eui64[7] == mac[5]; + && std::equal(eui64.begin(), eui64.begin()+3, mac.begin()) + && std::equal(eui64.begin()+5, eui64.begin()+8, mac.begin()+3); } prefix_ bool senf::operator==(EUI64 const & eui64, MACAddress const & mac) { - return mac==eui64; + return mac == eui64; } ///////////////////////////////cci.e///////////////////////////////////////