File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1415,7 +1415,7 @@ namespace ts {
1415
1415
}
1416
1416
1417
1417
/** Remove the *first* element satisfying `predicate`. */
1418
- export function unorderedRemoveFirstItemWhere < T > ( array : T [ ] , predicate : ( element : T ) => boolean ) : void {
1418
+ function unorderedRemoveFirstItemWhere < T > ( array : T [ ] , predicate : ( element : T ) => boolean ) : void {
1419
1419
for ( let i = 0 ; i < array . length ; i ++ ) {
1420
1420
if ( predicate ( array [ i ] ) ) {
1421
1421
unorderedRemoveItemAt ( array , i ) ;
Original file line number Diff line number Diff line change @@ -209,12 +209,13 @@ namespace ts {
209
209
watchDirectory ( directoryName : string , callback : DirectoryWatcherCallback , recursive : boolean ) : DirectoryWatcher {
210
210
const path = this . toPath ( directoryName ) ;
211
211
const callbacks = lookUp ( this . watchedDirectories , path ) || ( this . watchedDirectories [ path ] = [ ] ) ;
212
- callbacks . push ( { cb : callback , recursive } ) ;
212
+ const cbWithRecursive = { cb : callback , recursive } ;
213
+ callbacks . push ( cbWithRecursive ) ;
213
214
return {
214
215
referenceCount : 0 ,
215
216
directoryName,
216
217
close : ( ) => {
217
- unorderedRemoveFirstItemWhere ( callbacks , cb => cb . cb === callback ) ;
218
+ unorderedRemoveItem ( cbWithRecursive , callbacks ) ;
218
219
if ( ! callbacks . length ) {
219
220
delete this . watchedDirectories [ path ] ;
220
221
}
You can’t perform that action at this time.
0 commit comments