mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-29 10:52:20 +00:00
avutil/dict: Avoid check whose result is known in advance
We know that an AVDictionary is not empty if we have just added an entry to it, so only check for it being empty on the branch that does not do so. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
62af385b91
commit
f976ed7fcf
@ -126,12 +126,12 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
|
||||
}
|
||||
m->count++;
|
||||
} else {
|
||||
if (!m->count) {
|
||||
av_freep(&m->elems);
|
||||
av_freep(pm);
|
||||
}
|
||||
av_freep(©_key);
|
||||
}
|
||||
if (!m->count) {
|
||||
av_freep(&m->elems);
|
||||
av_freep(pm);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user