The function changes again in the next CL. This is just to make the review for the next CL a little easier, hopefully.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
for (size_t i = 0; i < buffer.size(); ++i) {Can also do range-based for-loop here to further modernize this code.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Can also do range-based for-loop here to further modernize this code.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: core/fxcrt/fx_random.cpp
Insertions: 2, Deletions: 2.
@@ -128,8 +128,8 @@
void FX_Random_MT_Fill(pdfium::span<uint32_t> buffer) {
void* context = ContextFromNextGlobalSeed();
- for (size_t i = 0; i < buffer.size(); ++i) {
- buffer[i] = FX_Random_MT_Generate(context);
+ for (uint32_t& val : buffer) {
+ val = FX_Random_MT_Generate(context);
}
FX_Random_MT_Close(context);
}
```
Rename FX_Random_MT_GenerateMT()
FX_Random_MT_Generate() and FX_Random_GenerateMT() have really similar
names, but one returns a random number and one fills a passed-in buffer
with random numbers. Make the latter more distinguishable by renaming it
to FX_Random_MT_Fill().
Then, modernize the function by using modern naming style and a
range-based for loop.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |