From 6528274d73e7a948fc5758007fdb0b9c05f1769e Mon Sep 17 00:00:00 2001 From: Onetchou <83351185+Onetchou@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:09:06 +0200 Subject: [PATCH] doc: updated comment about the generation of new ids --- src/libs/vpatterndb/vcontainer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index aa94e5e462ab..56fd122fad2d 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -404,14 +404,12 @@ quint32 VContainer::getId() * - It increments the static member variable `_id` to generate the next unique ID. * - The method returns the new value of `_id`. * - * @note Currently, the method simply increments the ID without reusing free IDs. This approach saves time but may need - * improvement in the future to reuse free IDs within the set of values. + * @note Currently, the method simply increments the ID without reusing free IDs. */ quint32 VContainer::getNextId() { - //TODO. Current count of ids are very big and allow us save time before someone will reach its max value. - //Better way, of cource, is to seek free ids inside the set of values and reuse them. - //But for now better to keep it as it is now. + //Because UINT_MAX is so big, it's impossible to run out of ids + //We don't try to reuse free ids to avoid the complexity of tracking them if (_id == UINT_MAX) { qCritical() << (tr("Number of free id exhausted."));