From 8da5e193c71b1576d97ea5eb00b33dfe1719b71d Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 28 Jan 2026 18:34:33 -0800 Subject: [PATCH] [mac] remove redundant `ExtAddress::operator==()` (#12344) The `ExtAddress` class inherits from `Equatable`, which already provides an `operator==` implementation that compares the object's memory content. --- src/core/mac/mac_types.cpp | 2 -- src/core/mac/mac_types.hpp | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/src/core/mac/mac_types.cpp b/src/core/mac/mac_types.cpp index f08ac8854..ce18d7e7d 100644 --- a/src/core/mac/mac_types.cpp +++ b/src/core/mac/mac_types.cpp @@ -75,8 +75,6 @@ void ExtAddress::SetFromIid(const Ip6::InterfaceIdentifier &aIid) #endif -bool ExtAddress::operator==(const ExtAddress &aOther) const { return (memcmp(m8, aOther.m8, sizeof(m8)) == 0); } - ExtAddress::InfoString ExtAddress::ToString(void) const { InfoString string; diff --git a/src/core/mac/mac_types.hpp b/src/core/mac/mac_types.hpp index 34532fdf0..4055d0a95 100644 --- a/src/core/mac/mac_types.hpp +++ b/src/core/mac/mac_types.hpp @@ -220,16 +220,6 @@ public: CopyAddress(aBuffer, m8, aByteOrder); } - /** - * Overloads operator `==` to evaluate whether or not two `ExtAddress` instances are equal. - * - * @param[in] aOther The other `ExtAddress` instance to compare with. - * - * @retval TRUE If the two `ExtAddress` instances are equal. - * @retval FALSE If the two `ExtAddress` instances are not equal. - */ - bool operator==(const ExtAddress &aOther) const; - /** * Converts an address to a string. *