Skip to content

Commit

Permalink
Microoptimization in merge
Browse files Browse the repository at this point in the history
Improves performance by about 10%.
  • Loading branch information
techee committed Oct 30, 2014
1 parent bdee133 commit cb9e4bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tagmanager/src/tm_tag.c
Expand Up @@ -899,7 +899,9 @@ static GPtrArray *merge(GPtrArray *big_array, GPtrArray *small_array,
while (i1 <= j1)
{
val1 = big_array->pdata[i1];
g_ptr_array_add(res_array, val1);
/* we allocated enough space so we are sure we don't need to reallocate
* the array - copy and increment the size directly so it can be inlined */
res_array->pdata[res_array->len++] = val1;
i1++;
}
}
Expand Down

0 comments on commit cb9e4bb

Please sign in to comment.