From 4fa78eec3daa1f0bac6c994e49e10bc6574a8d36 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 6 May 2025 10:18:22 -0400 Subject: [PATCH] MT#62181 RegisterCache: add get_lowest_expire Convenience function to obtain the expire time of the soonest binding to expire Change-Id: I5468d62ae373f6d254d6380492ae6739df2c3524 --- apps/sbc/RegisterCache.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/sbc/RegisterCache.h b/apps/sbc/RegisterCache.h index 3977daa5..1e858f3c 100644 --- a/apps/sbc/RegisterCache.h +++ b/apps/sbc/RegisterCache.h @@ -91,6 +91,14 @@ class AorEntry : public unordered_map } friend class AorHash; + +public: + long int get_lowest_expire() const { + auto it = bindings_by_time.cbegin(); + if (it == bindings_by_time.cend()) + return LONG_MAX; // empty sets go last + return (*it)->second.reg_expire; + } }; struct AliasEntry