optimized blenloader for loops #106573

Closed
glitchy-virophage wants to merge 31 commits from (deleted):main into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 512aa3bced - Show all commits

View File

@ -5073,7 +5073,7 @@ static void convert_pointer_array_64_to_32(BlendDataReader *reader,
/* Match pointer conversion rules from bh4_from_bh8 and cast_pointer. */
if (BLO_read_requires_endian_switch(reader)) {
int change = 0;
for (int i = array_size; --i) {
for (int i = array_size; --i; ) {
/*optimized loop to use deincrement instead to use less resources
because now it automatically stops when a reaches 0 and it loops
the same number of times*/
@ -5085,7 +5085,7 @@ static void convert_pointer_array_64_to_32(BlendDataReader *reader,
}
else {
int change = 0;
for (int i = array_size; --i) {
for (int i = array_size; --i; ) {
/*optimized loop to use deincrement instead to use less resources
because now it automatically stops when a reaches 0 and it loops
the same number of times*/
@ -5102,7 +5102,7 @@ static void convert_pointer_array_32_to_64(BlendDataReader * /*reader*/,
{
/* Match pointer conversion rules from bh8_from_bh4 and cast_pointer_32_to_64. */
int change = 0;
for (int i = array_size; --i) {
for (int i = array_size; --i; ) {
/*optimized loop to use deincrement instead to use less resources
because now it automatically stops when a reaches 0 and it loops
the same number of times*/