refactor: add items methods for directoryReferenceMap and fileReferenceMap

This commit is contained in:
Derrick Hammer 2024-02-29 11:32:13 -05:00
parent 5a0b742139
commit 7bd9cf11ae
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 20 additions and 0 deletions

View File

@ -11,9 +11,29 @@ import (
type directoryReferenceMap struct { type directoryReferenceMap struct {
linkedhashmap.Map linkedhashmap.Map
} }
func (drm directoryReferenceMap) Items() map[string]*DirectoryReference {
files := make(map[string]*DirectoryReference)
iter := drm.Iterator()
for iter.Next() {
files[iter.Key().(string)] = iter.Value().(*DirectoryReference)
}
return files
}
type fileReferenceMap struct { type fileReferenceMap struct {
linkedhashmap.Map linkedhashmap.Map
} }
func (drm fileReferenceMap) Items() map[string]*FileReference {
files := make(map[string]*FileReference)
iter := drm.Iterator()
for iter.Next() {
files[iter.Key().(string)] = iter.Value().(*FileReference)
}
return files
}
type fileReferenceSerializationMap struct { type fileReferenceSerializationMap struct {
linkedhashmap.Map linkedhashmap.Map
} }