Fix: bt_g_hash_table_contains(): handle `NULL`/0 values
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 23 Aug 2018 15:35:43 +0000 (11:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:07:36 +0000 (00:07 -0400)
commitc2888a2b9f644c9da6fec019db4c44fe8cb6e3be
tree23576a49089d98cdd6fe089dfd1bb4ff508ef63d
parentff205f0b502ed1f0c5f376ff9d48b4f2dcab18f3
Fix: bt_g_hash_table_contains(): handle `NULL`/0 values

Issue
=====
g_hash_table_lookup() returns `NULL` if the key is not found, but also
when the value is actually `NULL` (or 0). Therefore
bt_g_hash_table_contains() returns false when there's actually a
`NULL`/0 value for the given key.

Solution
========
Use g_hash_table_lookup_extended() which truly returns whether or not
the given key was found, and discard the returned value.

Known drawbacks
===============
None.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
include/babeltrace/compat/glib-internal.h
This page took 0.023907 seconds and 4 git commands to generate.