Skip to content

Commit 4159ae2

Browse files
committed
remove: unnecessary if else
Signed-off-by: wxiwnd <[email protected]>
1 parent 499257c commit 4159ae2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/bash_pinyin_completion

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,16 @@ _pinyin_completion() {
5555
if [[ "${compgen_opts[0]}" == -d ]]; then
5656
mapfile -t pinyin_matched < <(
5757
compgen -d -- |
58-
grep -v '^\.\{1,2\}$' | # Exclude . and ..
5958
bash-pinyin-completion-rs "$basepart" 2>/dev/null
6059
)
6160
else
6261
mapfile -t pinyin_matched < <(
6362
compgen -f -- |
6463
while IFS= read -r line; do
65-
if [[ "$line" != "." && "$line" != ".." ]]; then # Exclude . and ..
66-
if [ -d "$line" ]; then
67-
printf "%s/\n" "${line%%/}"
68-
else
69-
printf "%s\n" "$line"
70-
fi
64+
if [ -d "$line" ]; then
65+
printf "%s/\n" "${line%%/}"
66+
else
67+
printf "%s\n" "$line"
7168
fi
7269
done | bash-pinyin-completion-rs "$basepart" 2>/dev/null
7370
)

0 commit comments

Comments
 (0)