Commit 8053238
fix for requesting 0 randoms on empty collection (#20402)
previously if you requested 0 random items from an empty collection, it would mistakedly think we were requesting 1 item.
this commit moves the check for a request of zero random items to the beginning, so we don't run into this issue.
also add a test.1 parent f20a5ea commit 8053238
File tree
2 files changed
+13
-4
lines changed- src/Illuminate/Support
- tests/Support
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1082 | 1086 | | |
1083 | 1087 | | |
1084 | 1088 | | |
| |||
1089 | 1093 | | |
1090 | 1094 | | |
1091 | 1095 | | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
927 | 936 | | |
928 | 937 | | |
929 | 938 | | |
| |||
0 commit comments