mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-26 21:30:07 +00:00
spirv-fuzz: refactor to use RemoveAtRandomIndex (#3560)
Make the code in fuzzer_pass_merge_blocks.cpp simpler by using the RemoveAtRandomIndex function from FuzzerContext. See related comment in #3540
This commit is contained in:
parent
0d8fe0fba0
commit
c10d6cebbc
@ -53,9 +53,8 @@ void FuzzerPassMergeBlocks::Apply() {
|
||||
}
|
||||
|
||||
while (!potential_transformations.empty()) {
|
||||
uint32_t index = GetFuzzerContext()->RandomIndex(potential_transformations);
|
||||
auto transformation = potential_transformations.at(index);
|
||||
potential_transformations.erase(potential_transformations.begin() + index);
|
||||
auto transformation =
|
||||
GetFuzzerContext()->RemoveAtRandomIndex(&potential_transformations);
|
||||
MaybeApplyTransformation(transformation);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user