-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify for loop iteration termination conditions
Several tests use a for() loop to perform some action a random number of times. The termination condition of the loops contained a reference to $RANDOM. Because this expression is evaluated after each pass through the loop, the index was compared against a different random number each time. The actual behavior was thus more like a while() loop with a random termination condition than a typical for loop. This patch evalutes $RANDOM once to determine the number of passes through the loop, so the code's behavior is more obvious. Signed-off-by: Olaf Faaland <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9
- Loading branch information
1 parent
e6d0ae5
commit f4a019b
Showing
4 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters