i965: Simplify annotation_insert_error()
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -159,8 +159,6 @@ void
|
|||||||
annotation_insert_error(struct annotation_info *annotation, unsigned offset,
|
annotation_insert_error(struct annotation_info *annotation, unsigned offset,
|
||||||
const char *error)
|
const char *error)
|
||||||
{
|
{
|
||||||
struct annotation *ann;
|
|
||||||
|
|
||||||
if (!annotation->ann_count)
|
if (!annotation->ann_count)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -175,7 +173,6 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset,
|
|||||||
for (int i = 0; i < annotation->ann_count; i++) {
|
for (int i = 0; i < annotation->ann_count; i++) {
|
||||||
struct annotation *cur = &annotation->ann[i];
|
struct annotation *cur = &annotation->ann[i];
|
||||||
struct annotation *next = &annotation->ann[i + 1];
|
struct annotation *next = &annotation->ann[i + 1];
|
||||||
ann = cur;
|
|
||||||
|
|
||||||
if (next->offset <= offset)
|
if (next->offset <= offset)
|
||||||
continue;
|
continue;
|
||||||
@@ -190,11 +187,11 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset,
|
|||||||
next->block_start = NULL;
|
next->block_start = NULL;
|
||||||
annotation->ann_count++;
|
annotation->ann_count++;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ann->error)
|
if (cur->error)
|
||||||
ralloc_strcat(&ann->error, error);
|
ralloc_strcat(&cur->error, error);
|
||||||
else
|
else
|
||||||
ann->error = ralloc_strdup(annotation->mem_ctx, error);
|
cur->error = ralloc_strdup(annotation->mem_ctx, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user