mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
compiler/types: Don't duplicate empty string
We can use the static version of the empty string. There's no worry about freeing that string incorrectly since what is being deallocated later is the whole mem_ctx. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
This commit is contained in:
parent
247f940d37
commit
412fe99ea6
1 changed files with 1 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ glsl_type::glsl_type(const glsl_type *return_type,
|
|||
this->mem_ctx = ralloc_context(NULL);
|
||||
assert(this->mem_ctx != NULL);
|
||||
|
||||
this->name = ralloc_strdup(this->mem_ctx, "");
|
||||
this->name = "";
|
||||
|
||||
this->fields.parameters = rzalloc_array(this->mem_ctx,
|
||||
glsl_function_param, num_params + 1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue