diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-08-25 12:59:08 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-09-04 13:09:11 +0200 |
commit | 5f4bd8093671962093d9ec7d57ef65244b270dd4 (patch) | |
tree | c98ade2ef35a56cb3324a6e531535c22a8f97c63 /qobject/qlit.c | |
parent | 6c6084c1b0802f5265d5c7dc27f7125d9fd1cceb (diff) |
qlit: Replace open-coded qnum_get_int() by call
Bonus: rids us of a side effect in an assertion.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20170825105913.4060-10-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qobject/qlit.c')
-rw-r--r-- | qobject/qlit.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/qobject/qlit.c b/qobject/qlit.c index 07ad6b05e8..b1d9146220 100644 --- a/qobject/qlit.c +++ b/qobject/qlit.c @@ -43,8 +43,6 @@ static void compare_helper(QObject *obj, void *opaque) bool qlit_equal_qobject(const QLitObject *lhs, const QObject *rhs) { - int64_t val; - if (!rhs || lhs->type != qobject_type(rhs)) { return false; } @@ -53,8 +51,7 @@ bool qlit_equal_qobject(const QLitObject *lhs, const QObject *rhs) case QTYPE_QBOOL: return lhs->value.qbool == qbool_get_bool(qobject_to_qbool(rhs)); case QTYPE_QNUM: - g_assert(qnum_get_try_int(qobject_to_qnum(rhs), &val)); - return lhs->value.qnum == val; + return lhs->value.qnum == qnum_get_int(qobject_to_qnum(rhs)); case QTYPE_QSTRING: return (strcmp(lhs->value.qstr, qstring_get_str(qobject_to_qstring(rhs))) == 0); |