From 898567adfec49f22f23b633201c8d480b1a054fd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 20 Nov 2017 12:52:44 +0100 Subject: [PATCH] platform: don't return zero from nmp_object_id_hash() There is no principle problem with returning zero has hash value. But just don't do it. Our hash functions should not return zero. Instead, return nm_hash_static(). This is why the function exists. --- src/platform/nmp-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index 4b511ff2f5..ee4014ac3c 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -1070,7 +1070,7 @@ nmp_object_id_hash (const NMPObject *obj) NMHashState h; if (!obj) - return 0; + return nm_hash_static (914932607u); nm_hash_init (&h, 914932607u); nmp_object_id_hash_update (obj, &h);