Skip to content

Commit 24333e8

Browse files
committed
test other approach to for loop
1 parent 1521dc3 commit 24333e8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

.github/workflows/bench-test.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ jobs:
5757
working-directory: ./${{ matrix.project }}
5858
shell: bash
5959
run: |
60-
mapfile -t rs_files < <(find . -type f -name '*.rs' -exec readlink -f {} \;)
6160
echo "for_loop_count=0" >> $GITHUB_ENV
62-
echo "for_loop_count_in_file=0" >> $GITHUB_ENV
6361
64-
for file in "${rs_files[@]}"; do
62+
find . -type f -name '*.rs' | while read -r file; do
6563
echo "Checking $file"
66-
for_loop_count_in_file=$(grep -oE 'for\s+(\([^)]+\)|\w+)\s+in\s+[^{]+' "$file" | wc -l)
67-
echo "Count in file: $for_loop_count_in_file"
64+
echo "Count in file: $(grep -oE 'for\s+(\([^)]+\)|\w+)\s+in\s+[^{]+' "$file" | wc -l)"
6865
((for_loop_count += for_loop_count_in_file))
6966
done
7067
echo "for loop occurrences: $for_loop_count"

0 commit comments

Comments
 (0)