Skip to content

Commit

Permalink
refactoring.
Browse files Browse the repository at this point in the history
iv_index_tbl_newsize() usually returns iv_index_tbl->num_entries
because ivup->iv_extended is usually false.
  • Loading branch information
ko1 committed Nov 10, 2020
1 parent 2fed5f0 commit b557c57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions variable.c
Expand Up @@ -1038,13 +1038,13 @@ gen_ivtbl_dup(const struct gen_ivtbl *orig)
static uint32_t
iv_index_tbl_newsize(struct ivar_update *ivup)
{
uint32_t index = (uint32_t)ivup->index; /* should not overflow */
uint32_t newsize = (index+1) + (index+1)/4; /* (index+1)*1.25 */

if (!ivup->iv_extended) {
newsize = (uint32_t)ivup->u.iv_index_tbl->num_entries;
return (uint32_t)ivup->u.iv_index_tbl->num_entries;
}
else {
uint32_t index = (uint32_t)ivup->index; /* should not overflow */
return (index+1) + (index+1)/4; /* (index+1)*1.25 */
}
return newsize;
}

static int
Expand Down

0 comments on commit b557c57

Please sign in to comment.