From 7e8ce51da2cbb67f0ba56bd4de21ce20c2302d75 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 30 Mar 2024 16:48:01 +0100 Subject: [PATCH] post-increment operators must not use the int argument (it is zero) --- src/tl/tl/tlObjectCollection.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tl/tl/tlObjectCollection.h b/src/tl/tl/tlObjectCollection.h index c2a4ff820..362868125 100644 --- a/src/tl/tl/tlObjectCollection.h +++ b/src/tl/tl/tlObjectCollection.h @@ -116,12 +116,10 @@ public: /** * @brief Post-decrement */ - weak_or_shared_collection_iterator operator-- (int n) + weak_or_shared_collection_iterator operator-- (int) { weak_or_shared_collection_iterator ret = *this; - while (n-- > 0) { - operator-- (); - } + operator-- (); return ret; } @@ -138,12 +136,10 @@ public: /** * @brief Post-increment */ - weak_or_shared_collection_iterator operator++ (int n) + weak_or_shared_collection_iterator operator++ (int) { weak_or_shared_collection_iterator ret = *this; - while (n-- > 0) { - operator++ (); - } + operator++ (); return ret; }