@@ -23,7 +23,6 @@ import (
23
23
"fmt"
24
24
"os/exec"
25
25
"regexp"
26
- "slices"
27
26
"strings"
28
27
"time"
29
28
@@ -259,15 +258,15 @@ func (l *SketchLibrariesDetector) findIncludes(
259
258
if err != nil {
260
259
return err
261
260
}
262
- sourceFileQueue .push (mergedfile )
261
+ sourceFileQueue .Push (mergedfile )
263
262
264
263
l .queueSourceFilesFromFolder (sourceFileQueue , sketchBuildPath , false /* recurse */ , sketchBuildPath , sketchBuildPath )
265
264
srcSubfolderPath := sketchBuildPath .Join ("src" )
266
265
if srcSubfolderPath .IsDir () {
267
266
l .queueSourceFilesFromFolder (sourceFileQueue , srcSubfolderPath , true /* recurse */ , sketchBuildPath , sketchBuildPath )
268
267
}
269
268
270
- for ! sourceFileQueue .empty () {
269
+ for ! sourceFileQueue .Empty () {
271
270
err := l .findIncludesUntilDone (ctx , cache , sourceFileQueue , buildProperties , librariesBuildPath , platformArch )
272
271
if err != nil {
273
272
cachePath .Remove ()
@@ -303,7 +302,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
303
302
librariesBuildPath * paths.Path ,
304
303
platformArch string ,
305
304
) error {
306
- sourceFile := sourceFileQueue .pop ()
305
+ sourceFile := sourceFileQueue .Pop ()
307
306
sourcePath := sourceFile .SourcePath ()
308
307
targetFilePath := paths .NullPath ()
309
308
depPath := sourceFile .DepfilePath ()
@@ -443,7 +442,7 @@ func (l *SketchLibrariesDetector) queueSourceFilesFromFolder(
443
442
if err != nil {
444
443
return err
445
444
}
446
- sourceFileQueue .push (sourceFile )
445
+ sourceFileQueue .Push (sourceFile )
447
446
}
448
447
449
448
return nil
@@ -688,26 +687,3 @@ func writeCache(cache *includeCache, path *paths.Path) error {
688
687
}
689
688
return nil
690
689
}
691
-
692
- type uniqueSourceFileQueue []* sourceFile
693
-
694
- func (queue * uniqueSourceFileQueue ) push (value * sourceFile ) {
695
- if ! queue .contains (value ) {
696
- * queue = append (* queue , value )
697
- }
698
- }
699
-
700
- func (queue uniqueSourceFileQueue ) contains (target * sourceFile ) bool {
701
- return slices .ContainsFunc (queue , target .Equals )
702
- }
703
-
704
- func (queue * uniqueSourceFileQueue ) pop () * sourceFile {
705
- old := * queue
706
- x := old [0 ]
707
- * queue = old [1 :]
708
- return x
709
- }
710
-
711
- func (queue uniqueSourceFileQueue ) empty () bool {
712
- return len (queue ) == 0
713
- }
0 commit comments