Skip to content

Commit

Permalink
Make loop variables local
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavanki committed Jun 23, 2022
1 parent a6f0aa5 commit 06b8aff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions abom_components.bash
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ abom_render_progress() {
local pct=$(struct_get "$el" pct)

local bar_len=$(( pct * len / 100 ))
local i
for (( i = 0; i < len; i++ )); do
if (( i < bar_len )); then
printf ''
Expand Down
3 changes: 3 additions & 0 deletions abom_lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ abom_init() {
hide_cursor

TUI_LINES=$lines
local i
for (( i = 0; i < TUI_LINES; i++ )); do
echo
done
Expand All @@ -165,6 +166,7 @@ abom_clear() {
return
fi

local i
for (( i = 0; i < TUI_LINES; i++ )); do
delete_to_eol
next_line_start
Expand Down Expand Up @@ -192,6 +194,7 @@ abom_render() {
curr_pos=$(get_cursor_pos)
local diff_lines
diff_lines=$(( $(get_line_from_pos "${curr_pos}") - root_line ))
local i
for (( i = 0; i < TUI_LINES - diff_lines; i++ )); do
delete_to_eol
next_line_start
Expand Down
1 change: 1 addition & 0 deletions abom_struct.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
make_struct() {
local s=""
local argct=$#
local i
for (( i = 0; i < argct; i += 2 )); do
local key=$1
local value=$2
Expand Down

0 comments on commit 06b8aff

Please sign in to comment.