mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
tgsi/ureg: Simplify logic in tokens_expand().
This commit is contained in:
parent
83760d961f
commit
e44c77028c
1 changed files with 6 additions and 9 deletions
|
|
@ -140,8 +140,9 @@ static void tokens_expand( struct ureg_tokens *tokens,
|
|||
{
|
||||
unsigned old_size = tokens->size * sizeof(unsigned);
|
||||
|
||||
if (tokens->tokens == error_tokens)
|
||||
goto fail;
|
||||
if (tokens->tokens == error_tokens) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (tokens->count + count > tokens->size) {
|
||||
tokens->size = (1 << ++tokens->order);
|
||||
|
|
@ -150,13 +151,9 @@ static void tokens_expand( struct ureg_tokens *tokens,
|
|||
tokens->tokens = REALLOC(tokens->tokens,
|
||||
old_size,
|
||||
tokens->size * sizeof(unsigned));
|
||||
if (tokens->tokens == NULL)
|
||||
goto fail;
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
tokens_error(tokens);
|
||||
if (tokens->tokens == NULL) {
|
||||
tokens_error(tokens);
|
||||
}
|
||||
}
|
||||
|
||||
static void set_bad( struct ureg_program *ureg )
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue