tgsi/ureg: Simplify logic in tokens_expand().

This commit is contained in:
Michal Krol 2009-11-10 03:08:21 +01:00
parent 83760d961f
commit e44c77028c

View file

@ -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 )