mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-05 17:40:26 +00:00
Categories: Clean up deleted category records
This commit is contained in:
parent
0446fc4794
commit
b6cde49f9d
@ -73,10 +73,16 @@ func RemoveHyphaFromCategory(hyphaName, catName string) {
|
||||
mutex.Lock()
|
||||
if node, ok := hyphaToCategories[hyphaName]; ok {
|
||||
node.removeCategory(catName)
|
||||
if len(node.categoryList) == 0 {
|
||||
delete(hyphaToCategories, hyphaName)
|
||||
}
|
||||
}
|
||||
|
||||
if node, ok := categoryToHyphae[catName]; ok {
|
||||
node.removeHypha(hyphaName)
|
||||
if len(node.hyphaList) == 0 {
|
||||
delete(categoryToHyphae, catName)
|
||||
}
|
||||
}
|
||||
mutex.Unlock()
|
||||
go saveToDisk()
|
||||
|
Loading…
Reference in New Issue
Block a user