Improved performance
This commit is contained in:
@ -11,8 +11,8 @@ import (
|
||||
// Compile waits for the scan to finish and compiles all functions.
|
||||
func Compile(files <-chan *fs.File, functions <-chan *core.Function, errs <-chan error) (Result, error) {
|
||||
result := Result{}
|
||||
allFiles := make([]*fs.File, 0, 8)
|
||||
allFunctions := map[string]*core.Function{}
|
||||
allFiles := map[string]*fs.File{}
|
||||
|
||||
for functions != nil || files != nil || errs != nil {
|
||||
select {
|
||||
@ -31,7 +31,7 @@ func Compile(files <-chan *fs.File, functions <-chan *core.Function, errs <-chan
|
||||
continue
|
||||
}
|
||||
|
||||
allFiles[file.Path] = file
|
||||
allFiles = append(allFiles, file)
|
||||
|
||||
case err, ok := <-errs:
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user