From 3a1f8d56163fac82759acce39ccfda1e35f77001 Mon Sep 17 00:00:00 2001 From: lazio579 Date: Wed, 9 Jan 2019 17:41:14 +0800 Subject: [PATCH] Optimize some code --- libev/ev.c | 2 +- src/chassis-sql-log.c | 2 +- src/mysql-proxy-cli.c | 4 +--- src/network-mysqld.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libev/ev.c b/libev/ev.c index ca3685d..d057e6f 100644 --- a/libev/ev.c +++ b/libev/ev.c @@ -1386,7 +1386,7 @@ ecb_binary32_to_binary16 (uint32_t x) m = frexp (x, &e) * 0x20000000000000U; - r = m & 0x8000000000000000;; + r = m & 0x8000000000000000; if (r) m = -m; diff --git a/src/chassis-sql-log.c b/src/chassis-sql-log.c index 34cb6f0..6c21531 100644 --- a/src/chassis-sql-log.c +++ b/src/chassis-sql-log.c @@ -80,7 +80,7 @@ static void get_current_time_str(GString *str) { } static struct rfifo *rfifo_alloc(guint size) { - struct rfifo *ret = (struct rfifo *)g_malloc0(sizeof(struct rfifo));; + struct rfifo *ret = (struct rfifo *)g_malloc0(sizeof(struct rfifo)); if (!ret) { return NULL; diff --git a/src/mysql-proxy-cli.c b/src/mysql-proxy-cli.c index 3c09cb0..1dfd66e 100644 --- a/src/mysql-proxy-cli.c +++ b/src/mysql-proxy-cli.c @@ -990,10 +990,8 @@ main_cmdline(int argc, char **argv) opts = chassis_options_new(); opts->ignore_unknown = TRUE; srv->options = opts; - srv->argv = argv; srv->argc = argc; - - srv->argv = g_new0(char *, argc + 1); + srv->argv = g_new0(char *, argc); int i; for (i = 0; i < argc; i++) { srv->argv[i] = g_strdup(argv[i]); diff --git a/src/network-mysqld.c b/src/network-mysqld.c index 206faa0..1683ed9 100644 --- a/src/network-mysqld.c +++ b/src/network-mysqld.c @@ -3899,7 +3899,7 @@ network_mysqld_process_select_resp(network_mysqld_con *con, network_socket *serv } else { network_queue *reserved_queue = con->client->send_queue; con->client->send_queue = server->recv_queue_raw; - server->recv_queue_raw = server->recv_queue;; + server->recv_queue_raw = server->recv_queue; server->recv_queue = reserved_queue; }