Commit 9998161
committed
Prevent modulo in places where we can check the length
NFC.
We know maxLength must be positive and non-zero, and therefore, i += 1 will be the next index until we reach maxLength, in which case the result is 0. Rather than perform a modulo, which requires division, every time, we can just reset i when it reaches the end of the buffer.1 parent 63a8d8c commit 9998161
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
992 | 995 | | |
993 | 996 | | |
994 | 997 | | |
| |||
1067 | 1070 | | |
1068 | 1071 | | |
1069 | 1072 | | |
1070 | | - | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1071 | 1077 | | |
1072 | 1078 | | |
1073 | 1079 | | |
| |||
0 commit comments