@@ -23,7 +23,6 @@ import (
2323 "fmt"
2424 "os/exec"
2525 "regexp"
26- "slices"
2726 "strings"
2827 "time"
2928
@@ -262,15 +261,15 @@ func (l *SketchLibrariesDetector) findIncludes(
262261 if err != nil {
263262 return err
264263 }
265- sourceFileQueue .push (mergedfile )
264+ sourceFileQueue .Push (mergedfile )
266265
267266 l .queueSourceFilesFromFolder (sourceFileQueue , sketchBuildPath , false /* recurse */ , sketchBuildPath , sketchBuildPath )
268267 srcSubfolderPath := sketchBuildPath .Join ("src" )
269268 if srcSubfolderPath .IsDir () {
270269 l .queueSourceFilesFromFolder (sourceFileQueue , srcSubfolderPath , true /* recurse */ , sketchBuildPath , sketchBuildPath )
271270 }
272271
273- for ! sourceFileQueue .empty () {
272+ for ! sourceFileQueue .Empty () {
274273 err := l .findIncludesUntilDone (ctx , cache , sourceFileQueue , buildProperties , librariesBuildPath , platformArch )
275274 if err != nil {
276275 cachePath .Remove ()
@@ -306,7 +305,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
306305 librariesBuildPath * paths.Path ,
307306 platformArch string ,
308307) error {
309- sourceFile := sourceFileQueue .pop ()
308+ sourceFile := sourceFileQueue .Pop ()
310309 sourcePath := sourceFile .SourcePath ()
311310 targetFilePath := paths .NullPath ()
312311 depPath := sourceFile .DepfilePath ()
@@ -446,7 +445,7 @@ func (l *SketchLibrariesDetector) queueSourceFilesFromFolder(
446445 if err != nil {
447446 return err
448447 }
449- sourceFileQueue .push (sourceFile )
448+ sourceFileQueue .Push (sourceFile )
450449 }
451450
452451 return nil
@@ -690,26 +689,3 @@ func writeCache(cache *includeCache, path *paths.Path) error {
690689 }
691690 return nil
692691}
693-
694- type uniqueSourceFileQueue []* sourceFile
695-
696- func (queue * uniqueSourceFileQueue ) push (value * sourceFile ) {
697- if ! queue .contains (value ) {
698- * queue = append (* queue , value )
699- }
700- }
701-
702- func (queue uniqueSourceFileQueue ) contains (target * sourceFile ) bool {
703- return slices .ContainsFunc (queue , target .Equals )
704- }
705-
706- func (queue * uniqueSourceFileQueue ) pop () * sourceFile {
707- old := * queue
708- x := old [0 ]
709- * queue = old [1 :]
710- return x
711- }
712-
713- func (queue uniqueSourceFileQueue ) empty () bool {
714- return len (queue ) == 0
715- }
0 commit comments