mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Remove redundant else branches (#86)
Else branches are an anti pattern especially if you can easily return from the previous branch. Over time, else branches cause deep nesting and make code unreadable and unmaintainable. Remove elses where possible.
This commit is contained in:
@@ -70,13 +70,13 @@ export function usePipedInput(): PipedInputState {
|
||||
stdin.removeListener('error', handleError);
|
||||
stdin.removeListener('end', handleEnd);
|
||||
};
|
||||
} else {
|
||||
// No piped input (running interactively)
|
||||
setIsLoading(false);
|
||||
// Optionally set an 'info' state or just let isLoading=false & isPiped=false suffice
|
||||
// setError('No piped input detected.'); // Maybe don't treat this as an 'error'
|
||||
}
|
||||
|
||||
// No piped input (running interactively)
|
||||
setIsLoading(false);
|
||||
// Optionally set an 'info' state or just let isLoading=false & isPiped=false suffice
|
||||
// setError('No piped input detected.'); // Maybe don't treat this as an 'error'
|
||||
|
||||
// Intentionally run only once on mount or when stdin theoretically changes
|
||||
}, [stdin, isRawModeSupported, setRawMode /*, exit */]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user