[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2022-01-11 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=384039

Igor Kushnir  changed:

   What|Removed |Added

   Version Fixed In|5.90|5.91
 CC||igor...@gmail.com

--- Comment #6 from Igor Kushnir  ---
Changing the "Version Fixed In" field from 5.90 to 5.91 because the fix was
merged later than the commit message anticipated.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2022-01-02 Thread David Faure
https://bugs.kde.org/show_bug.cgi?id=384039

David Faure  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Version Fixed In||5.90
  Latest Commit||https://invent.kde.org/fram
   ||eworks/kconfig/commit/295ea
   ||7632ac7cc2cc3eda79b7af8614d
   ||5ff95a41

--- Comment #5 from David Faure  ---
Git commit 295ea7632ac7cc2cc3eda79b7af8614d5ff95a41 by David Faure, on behalf
of Igor Kushnir.
Committed on 02/01/2022 at 08:31.
Pushed by dfaure into branch 'master'.

Exclude deleted groups from groupList()

This commit is an alternative to the earlier incorrect and reverted
b3dc879e8b108c26c929bfbe551bcdf77f140e94. That commit contained several
mistakes and an algorithmic complexity increase:
1) the added conditions were inverted: should have been
   `hasNonDeletedEntries` (without `!`);
2) KConfigPrivate::groupList() passed group instead of key.mGroup to
   hasNonDeletedEntries();
3) The complexity of hasNonDeletedEntries() is O(entryMap.size()). Calls
   to this function were added into loops that iterated entryMap.size()
   times. So the overall complexity of groupList() increased from linear
   to quadratic.

This fix collects `mGroup`s of non-deleted key entries instead of
`mGroup`s of group entries. The number of key entries can be much
greater than the number of group entries, so this fix hurts performance.
But at least the algorithmic complexity of groupList() stays linear.
Future commits can optimize the loops and make them almost as fast or
even faster than before this fix.

The `!key.mKey.isNull() && !entryMapIt->bDeleted` checks added in this
commit are consistent with the check in
KConfigPrivate::hasNonDeletedEntries(). KConfig::hasGroupImpl() forwards
its argument to hasNonDeletedEntries() with the following comment:
// No need to look for the actual group entry anymore, or for subgroups:
// a group exists if it contains any non-deleted entry.
FIXED-IN: 5.90

M  +7-1autotests/kconfigtest.cpp
M  +2-2src/core/kconfig.cpp

https://invent.kde.org/frameworks/kconfig/commit/295ea7632ac7cc2cc3eda79b7af8614d5ff95a41

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2021-12-24 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=384039

Bug Janitor Service  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|REPORTED|ASSIGNED

--- Comment #4 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/frameworks/kconfig/-/merge_requests/95

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2017-09-17 Thread Christoph Feck
https://bugs.kde.org/show_bug.cgi?id=384039

--- Comment #3 from Christoph Feck  ---
To upload patches, use https://phabricator.kde.org/differential/diff/create/

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2017-08-26 Thread Michel Ludwig
https://bugs.kde.org/show_bug.cgi?id=384039

--- Comment #2 from Michel Ludwig  ---
Created attachment 107530
  --> https://bugs.kde.org/attachment.cgi?id=107530&action=edit
Patch for solving the issue

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kconfig] [Bug 384039] KConfig::groupList() returns deleted group

2017-08-26 Thread Michel Ludwig
https://bugs.kde.org/show_bug.cgi?id=384039

--- Comment #1 from Michel Ludwig  ---
Created attachment 107529
  --> https://bugs.kde.org/attachment.cgi?id=107529&action=edit
Accompanying CMakeLists.txt

-- 
You are receiving this mail because:
You are watching all bug changes.