Commit ef5cb24
fix: runtime error index out of range caused by nextCleanupBucket
- Adjusted cache size and TTL in `sieve_test.go` for more comprehensive testing
- Implemented a constant `numberOfBuckets` and utilized it in `sieve.go` for cache storage
- Updated `addToBucket` function to incorporate the new `numberOfBuckets` constant and `int8` `bucketID` type
- Modified `bucketId` calculation in `addToBucket` function using `s.nextCleanupBucket` of type `float64`
- Enhanced workload for testing in `sieve_test.go` from 256 to 10240 for rigorous testing1 parent 75f0941 commit ef5cb24
2 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
252 | | - | |
253 | | - | |
| 256 | + | |
| 257 | + | |
254 | 258 | | |
255 | 259 | | |
256 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
| 208 | + | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
0 commit comments