
4 Dec
2020
4 Dec
'20
1:38 a.m.
On Thu, Dec 03, 2020 at 13:36:04 +0100, Michal Privoznik wrote:
The only test we do when checking for UUID validity is that whether all bytes are the same (invalid UUID) or not (valid UUID). The algorithm we use is needlessly complicated.
Also, the checked UUID is not modified and hence the argument can be of 'const' type.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/util/viruuid.c | 17 +++++++---------- src/util/viruuid.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-)
I've briefly thought whether we could replace the internals by a memset of a temp array and then memcmp, but that doesn't seem to be worth. Reviewed-by: Peter Krempa <pkrempa@redhat.com>