From f1bc9edb46551039e4b8c14e535300ce942bef9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 5 Dec 2024 09:23:00 +0000 Subject: libcamera: utils: StringSplitter: Inline some trivial methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inline some of the more trivial methods so that they can be inlined by the compiler. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/libcamera/base/utils.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 957150cb..c4a06660 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -204,7 +204,11 @@ public: iterator &operator++(); std::string operator*() const; - bool operator!=(const iterator &other) const; + + bool operator!=(const iterator &other) const + { + return pos_ != other.pos_; + } private: const StringSplitter *ss_; @@ -212,8 +216,15 @@ public: std::string::size_type next_; }; - iterator begin() const; - iterator end() const; + iterator begin() const + { + return { this, 0 }; + } + + iterator end() const + { + return { this, std::string::npos }; + } private: std::string str_; -- cgit v1.2.1