From ae9257bf3b49a8ef331298fce942720bfb91bd2f Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 4 Jan 2025 17:36:54 +0300 Subject: [PATCH] AK: Define operator== for BitmapView --- AK/BitmapView.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AK/BitmapView.h b/AK/BitmapView.h index 6ae5ddeae6e..83108440127 100644 --- a/AK/BitmapView.h +++ b/AK/BitmapView.h @@ -362,6 +362,17 @@ public: static constexpr size_t max_size = 0xffffffff; + [[nodiscard]] bool operator==(BitmapView const& other) const + { + if (size() != other.size()) + return false; + for (size_t i = 0; i < size_in_bytes(); ++i) { + if (m_data[i] != other.m_data[i]) + return false; + } + return true; + } + protected: u8* m_data { nullptr }; size_t m_size { 0 };