Skip to content

Commit 10f579d

Browse files
committed
clean code, remove necessary arithmetic parenthesis
1 parent dc0e796 commit 10f579d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

a2l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ readonly -a ECHO_COLORS=(31 32 37 34 33 35 36)
2626
COUNT=0
2727

2828
for a; do
29-
colorEcho "${ECHO_COLORS[$((COUNT++ % ${#ECHO_COLORS[@]}))]}" "$a"
29+
colorEcho "${ECHO_COLORS[COUNT++ % ${#ECHO_COLORS[@]}]}" "$a"
3030
done

coat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ readonly eend=$'\033[0m' # escape end
2020
readonly -a ECHO_COLORS=(31 32 37 34 33 35 36)
2121
COUNT=0
2222
colorEcho() {
23-
local color="${ECHO_COLORS[$((COUNT++ % ${#ECHO_COLORS[@]}))]}"
23+
local color="${ECHO_COLORS[COUNT++ % ${#ECHO_COLORS[@]}]}"
2424
# check isatty in bash https://stackoverflow.com/questions/10022323
2525
# if stdout is console, turn on color output.
2626
[ -t 1 ] && echo "$ec[1;${color}m$@$eend" || echo "$@"

rp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
argc=$#
2525

2626
# Get last argument
27-
relativeTo="${argv[$((argc - 1))]}"
28-
files=( "${argv[@]:0:$((argc - 1))}" )
27+
relativeTo="${argv[argc - 1]}"
28+
files=( "${argv[@]:0:argc - 1}" )
2929
}
3030

3131
[ -f "$relativeTo" ] && relativeTo="$(dirname "$relativeTo")"

show-duplicate-java-classes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def print_class_paths(class_paths):
7272
print("class paths to find:")
7373
print("=" * 80)
7474
for idx, class_path in enumerate(class_paths):
75-
print(("%-3d: %s" % (idx + 1, class_path)))
75+
print("%-3d: %s" % (idx + 1, class_path))
7676

7777

7878
if __name__ == '__main__':

0 commit comments

Comments
 (0)