diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -112,9 +112,11 @@ serd_env_add(SerdEnv* env, { SerdPrefix* const prefix = serd_env_find(env, name->buf, name->n_bytes); if (prefix) { - SerdNode old_prefix_uri = prefix->uri; - prefix->uri = serd_node_copy(uri); - serd_node_free(&old_prefix_uri); + if (!serd_node_equals(&prefix->uri, uri)) { + SerdNode old_prefix_uri = prefix->uri; + prefix->uri = serd_node_copy(uri); + serd_node_free(&old_prefix_uri); + } } else { env->prefixes = (SerdPrefix*)realloc( env->prefixes, (++env->n_prefixes) * sizeof(SerdPrefix)); |