Commit c9b6ca5
committed
Avoid unnecessary calls in
The reference page for `File::rewindDirectory` provides a sketch demonstrating its usage.
This code calls the function after iterating over each directory on the card. This would be necessary if the
`printDirectory` function was configured to iterate over that directory multiple times, but it is not. So the calls are
redundant.
Moving the call to the `setup` function has the following benefits:
- Makes the use of the function more prominent. The reader can get an overview of what the program is doing without
delving into the `printDirectory` function
- Avoids the misconception that it is required to call the function recursively as was done beforerewindDirectory reference code1 parent 619fe19 commit c9b6ca5
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
| |||
845 | 846 | | |
846 | 847 | | |
847 | 848 | | |
848 | | - | |
849 | | - | |
850 | 849 | | |
851 | 850 | | |
852 | 851 | | |
| |||
0 commit comments