All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhuguanghong <zhuguanghong@uniontech.com>
To: pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com
Cc: zhuguanghong <zhuguanghong@uniontech.com>, qemu-devel@nongnu.org
Subject: [PATCH] qom/object.c 'if (type_table == NULL)' statement is redundant , delete it.
Date: Wed, 21 Jul 2021 16:44:46 +0800	[thread overview]
Message-ID: <20210721084446.26377-1-zhuguanghong@uniontech.com> (raw)

Signed-off-by: zhuguanghong <zhuguanghong@uniontech.com>
---
 qom/object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 6a01d56546..c8f5481afe 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -78,9 +78,7 @@ static GHashTable *type_table_get(void)
 {
     static GHashTable *type_table;
 
-    if (type_table == NULL) {
-        type_table = g_hash_table_new(g_str_hash, g_str_equal);
-    }
+    type_table = g_hash_table_new(g_str_hash, g_str_equal);
 
     return type_table;
 }
-- 
2.20.1





             reply	other threads:[~2021-07-21 13:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  8:44 zhuguanghong [this message]
2021-07-21 13:55 ` [PATCH] qom/object.c 'if (type_table == NULL)' statement is redundant , delete it Marc-André Lureau
2021-07-21 13:59   ` Daniel P. Berrangé
2021-07-22  9:15     ` [PATCH v2] " 朱光宏
2021-07-22  9:19       ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210721084446.26377-1-zhuguanghong@uniontech.com \
    --to=zhuguanghong@uniontech.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.