@@ -78,7 +78,7 @@ type diffEntry struct {
78
78
79
79
type snapshot struct {
80
80
snap map [string ]* diffEntry
81
- defaultLibs * collections.Set [string ]
81
+ defaultLibs * collections.SyncSet [string ]
82
82
}
83
83
84
84
type testSys struct {
@@ -116,7 +116,7 @@ func (s *testSys) ensureLibPathExists(path string) {
116
116
path = tscLibPath + "/" + path
117
117
if _ , ok := s .TestFS ().ReadFile (path ); ! ok {
118
118
if s .fs .defaultLibs == nil {
119
- s .fs .defaultLibs = collections.NewSetWithSizeHint [string ]( tsoptions . LibFilesSet . Len () + len ( tsoptions . TargetToLibMap ()) + 1 )
119
+ s .fs .defaultLibs = & collections.SyncSet [string ]{}
120
120
}
121
121
s .fs .defaultLibs .Add (path )
122
122
err := s .TestFS ().WriteFile (path , tscDefaultLibContent , false )
@@ -225,20 +225,23 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) {
225
225
}
226
226
}
227
227
}
228
- var defaultLibs * collections.Set [string ]
228
+ var defaultLibs collections.SyncSet [string ]
229
229
if s .fs .defaultLibs != nil {
230
- defaultLibs = s .fs .defaultLibs .Clone ()
230
+ s .fs .defaultLibs .Range (func (libPath string ) bool {
231
+ defaultLibs .Add (libPath )
232
+ return true
233
+ })
231
234
}
232
235
s .serializedDiff = & snapshot {
233
236
snap : snap ,
234
- defaultLibs : defaultLibs ,
237
+ defaultLibs : & defaultLibs ,
235
238
}
236
239
fmt .Fprintln (baseline )
237
240
}
238
241
239
242
func (s * testSys ) reportFSEntryDiff (baseline io.Writer , newDirContent * diffEntry , path string ) {
240
243
var oldDirContent * diffEntry
241
- var defaultLibs * collections.Set [string ]
244
+ var defaultLibs * collections.SyncSet [string ]
242
245
if s .serializedDiff != nil {
243
246
oldDirContent = s .serializedDiff .snap [path ]
244
247
defaultLibs = s .serializedDiff .defaultLibs
0 commit comments