Skip to content

Commit e6c2891

Browse files
author
BishalRD
committed
Fix google-gemini#3: Remove unnecessary abort signal check in findFilesWithGlob function
- Remove redundant abort check before glob operation (no async operations between checks) - Keep abort check at function start and after async glob operation where signal can actually change - Improves performance by eliminating unnecessary CPU cycles
1 parent 5da5f6f commit e6c2891

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

packages/cli/src/ui/hooks/useCompletion.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,11 @@ export function useCompletion(
389389
signal: AbortSignal,
390390
maxResults = 30,
391391
): Promise<Suggestion[]> => {
392-
// Check if operation was aborted
393392
if (signal.aborted) {
394393
return [];
395394
}
396395

397396
const globPattern = `**/${searchPrefix}*`;
398-
// Check abort signal before expensive glob operation
399-
if (signal.aborted) {
400-
return [];
401-
}
402397
const files = await glob(globPattern, {
403398
cwd,
404399
dot: searchPrefix.startsWith('.'),

0 commit comments

Comments
 (0)