From 3348822390b669fb8573b6649f8a0b313eaa03d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Tue, 13 Feb 2024 17:47:23 -0300 Subject: [PATCH] ... --- src/common/utility/tarray.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/common/utility/tarray.h b/src/common/utility/tarray.h index f849e9cca5..b642f3c87e 100644 --- a/src/common/utility/tarray.h +++ b/src/common/utility/tarray.h @@ -576,6 +576,35 @@ public: return f; } + bool SortedDelete(const T& obj) + { + auto f = SortedFind(obj, true); + if (f == Size()) + { + Delete(f); + return true; + } + else + { + return false; + } + } + + template + bool SortedDelete(const T& obj, Func lt) + { + auto f = SortedFind(obj, lt, true); + if (f == Size()) + { + Delete(f); + return true; + } + else + { + return false; + } + } + bool Pop () { if (Count > 0)