Commit 069ee666 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: preallocate children map on resize

Change-Id: I1ed0c8094041a5b00e97a5ece10dfac05523a4cd
parent 88c07749
...@@ -58,7 +58,7 @@ func (c *inodeChildren) get(name string) *Inode { ...@@ -58,7 +58,7 @@ func (c *inodeChildren) get(name string) *Inode {
func (c *inodeChildren) compact() { func (c *inodeChildren) compact() {
nc := make([]childEntry, 0, 2*len(c.childrenMap)+1) nc := make([]childEntry, 0, 2*len(c.childrenMap)+1)
nm := make(map[string]int, len(nc)) nm := make(map[string]int, len(c.childrenMap))
for _, e := range c.children { for _, e := range c.children {
if e.Inode == nil { if e.Inode == nil {
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment