diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-09 15:12:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-09 15:12:56 -0500 |
| commit | eaec140f7c823012c09536175d8917dddcacdb7c (patch) | |
| tree | aaec7165d5ceee9b581944602c7d2c1400c04961 /src/categories.h | |
| parent | 135d23c20a705825af8fe5c38d7dbba1d3934986 (diff) | |
| parent | 6781451ab2e0bda097a699d216c092e6d3842aa1 (diff) | |
Merge pull request #1349 from isanae/master
Handle category cycles by putting parent ids in a set
Diffstat (limited to 'src/categories.h')
| -rw-r--r-- | src/categories.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/categories.h b/src/categories.h index e8ec763b..e4a3ede9 100644 --- a/src/categories.h +++ b/src/categories.h @@ -124,7 +124,7 @@ public: * @param parentID the parent id to test for
* @return true if id is a child of parentID
**/
- bool isDecendantOf(int id, int parentID) const;
+ bool isDescendantOf(int id, int parentID) const;
/**
* @brief test if the specified category has child categories
@@ -209,7 +209,8 @@ private: std::map<int, unsigned int> m_NexusMap;
private:
-
+ // called by isDescendantOf()
+ bool isDescendantOfImpl(int id, int parentID, std::set<int>& seen) const;
};
|
