mirror of
https://github.com/Z3Prover/z3
synced 2026-02-23 00:37:36 +00:00
Standardize for-loop increments to prefix form (++i) (#8199)
* Initial plan * Convert postfix to prefix increment in for loops Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix member variable increment conversion bug Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Update API generator to produce prefix increments Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
851b8ea31c
commit
317dd92105
475 changed files with 3237 additions and 3237 deletions
|
|
@ -44,7 +44,7 @@ static void test_move_after() {
|
|||
}
|
||||
|
||||
void apply_permutation_copy(unsigned sz, unsigned const * src, unsigned const * p, unsigned * target) {
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
target[i] = src[p[i]];
|
||||
}
|
||||
}
|
||||
|
|
@ -57,16 +57,16 @@ static void test_apply_permutation(unsigned sz, unsigned num_tries, unsigned max
|
|||
p.resize(sz);
|
||||
new_data.resize(sz);
|
||||
random_gen g;
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
p[i] = i;
|
||||
// fill data with random numbers
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
data[i] = g() % max;
|
||||
for (unsigned k = 0; k < num_tries; k ++) {
|
||||
shuffle(p.size(), p.data(), g);
|
||||
apply_permutation_copy(sz, data.data(), p.data(), new_data.data());
|
||||
apply_permutation(sz, data.data(), p.data());
|
||||
for (unsigned i = 0; i < 0; i++)
|
||||
for (unsigned i = 0; i < 0; ++i)
|
||||
ENSURE(data[i] == new_data[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue