1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-11-29 13:25:14 +00:00

Throw away all backlink-related stuff

This commit is contained in:
bouncepaw
2021-03-14 18:16:30 +05:00
parent 8e94048f15
commit 8fc036ba1c
11 changed files with 108 additions and 308 deletions

View File

@@ -11,8 +11,6 @@ import (
// Index finds all hypha files in the full `path` and saves them to the hypha storage.
func Index(path string) {
byNamesMutex.Lock()
defer byNamesMutex.Unlock()
byNames = make(map[string]*Hypha)
ch := make(chan *Hypha, 5)
@@ -23,11 +21,10 @@ func Index(path string) {
for h := range ch {
// At this time it is safe to ignore the mutex, because there is only one worker.
if oldHypha, ok := byNames[h.Name]; ok {
oldHypha.MergeIn(h)
if oh := ByName(h.Name); oh.Exists {
oh.MergeIn(h)
} else {
byNames[h.Name] = h
IncrementCount()
h.Insert()
}
}
}