Skip to content

Commit 0f77c42

Browse files
authored
Fix a couple of Project/ATA bugs (#1028)
1 parent cdff2b1 commit 0f77c42

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

internal/project/ata.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ func (ti *TypingsInstaller) invokeRoutineToInstallTypings(
323323
if pendingRequestsCount == 1 {
324324
ti.pendingRunRequests = nil
325325
} else {
326+
ti.pendingRunRequests[0] = nil // ensure the request is GC'd
326327
ti.pendingRunRequests = ti.pendingRunRequests[1:]
327328
}
328329
}

internal/project/discovertypings.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func DiscoverTypings(
6969
}
7070

7171
// add typings for unresolved imports
72-
modules := slices.Compact(core.Map(typingsInfo.UnresolvedImports, core.NonRelativeModuleNameForTypingCache))
72+
modules := core.Map(typingsInfo.UnresolvedImports, core.NonRelativeModuleNameForTypingCache)
73+
slices.Sort(modules)
74+
modules = slices.Compact(modules)
7375
addInferredTypings(fs, log, inferredTypings, modules, "Inferred typings from unresolved imports")
7476

7577
// Remove typings that the user has added to the exclude list

internal/project/project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ func setIsEqualTo(arr1 []string, arr2 []string) bool {
102102
if slices.Equal(arr1, arr2) {
103103
return true
104104
}
105-
compact1 := slices.Compact(arr1)
106-
compact2 := slices.Compact(arr2)
105+
compact1 := slices.Clone(arr1)
106+
compact2 := slices.Clone(arr2)
107107
slices.Sort(compact1)
108108
slices.Sort(compact2)
109109
return slices.Equal(compact1, compact2)

0 commit comments

Comments
 (0)