@@ -370,10 +370,8 @@ const char *get_filename_from_path(const char *path) {
370
370
fname = strrchr(path, '\\');
371
371
else
372
372
fname = strrchr(path, '/');
373
- if (fname == nullptr)
374
- return path;
375
- else
376
- return ++fname;
373
+ if (fname == nullptr) return path;
374
+ return ++fname;
377
375
}
378
376
379
377
static uint opt_protocol = 0;
@@ -828,12 +826,9 @@ static int async_mysql_next_result_wrapper(MYSQL *mysql) {
828
826
const int result = socket_event_listen(mysql_get_socket_descriptor(mysql));
829
827
if (result == -1) return 1;
830
828
}
831
- if (status == NET_ASYNC_ERROR)
832
- return 1;
833
- else if (status == NET_ASYNC_COMPLETE_NO_MORE_RESULTS)
834
- return -1;
835
- else
836
- return 0;
829
+ if (status == NET_ASYNC_ERROR) return 1;
830
+ if (status == NET_ASYNC_COMPLETE_NO_MORE_RESULTS) return -1;
831
+ return 0;
837
832
}
838
833
839
834
static MYSQL *async_mysql_real_connect_wrapper(
@@ -847,10 +842,8 @@ static MYSQL *async_mysql_real_connect_wrapper(
847
842
NET_ASYNC_NOT_READY) {
848
843
t.check();
849
844
}
850
- if (status == NET_ASYNC_ERROR)
851
- return nullptr;
852
- else
853
- return mysql;
845
+ if (status == NET_ASYNC_ERROR) return nullptr;
846
+ return mysql;
854
847
}
855
848
856
849
static int async_mysql_query_wrapper(MYSQL *mysql, const char *query) {
@@ -885,17 +878,13 @@ static void async_mysql_free_result_wrapper(MYSQL_RES *result) {
885
878
--async-client option is set or not.
886
879
*/
887
880
static MYSQL_ROW mysql_fetch_row_wrapper(MYSQL_RES *res) {
888
- if (enable_async_client)
889
- return async_mysql_fetch_row_wrapper(res);
890
- else
891
- return mysql_fetch_row(res);
881
+ if (enable_async_client) return async_mysql_fetch_row_wrapper(res);
882
+ return mysql_fetch_row(res);
892
883
}
893
884
894
885
static MYSQL_RES *mysql_store_result_wrapper(MYSQL *mysql) {
895
- if (enable_async_client)
896
- return async_mysql_store_result_wrapper(mysql);
897
- else
898
- return mysql_store_result(mysql);
886
+ if (enable_async_client) return async_mysql_store_result_wrapper(mysql);
887
+ return mysql_store_result(mysql);
899
888
}
900
889
901
890
static int mysql_real_query_wrapper(MYSQL *mysql, const char *query,
@@ -905,8 +894,7 @@ static int mysql_real_query_wrapper(MYSQL *mysql, const char *query,
905
894
906
895
if (enable_async_client)
907
896
return async_mysql_real_query_wrapper(mysql, query, length);
908
- else
909
- return mysql_real_query(mysql, query, length);
897
+ return mysql_real_query(mysql, query, length);
910
898
}
911
899
912
900
static int mysql_send_query_wrapper(MYSQL *mysql, const char *query,
@@ -916,8 +904,7 @@ static int mysql_send_query_wrapper(MYSQL *mysql, const char *query,
916
904
917
905
if (enable_async_client)
918
906
return async_mysql_send_query_wrapper(mysql, query, length);
919
- else
920
- return mysql_send_query(mysql, query, length);
907
+ return mysql_send_query(mysql, query, length);
921
908
}
922
909
923
910
static bool mysql_read_query_result_wrapper(MYSQL *mysql) {
@@ -933,17 +920,13 @@ static int mysql_query_wrapper(MYSQL *mysql, const char *query) {
933
920
int rc;
934
921
if (0 != (rc = global_attrs->set_params(mysql))) return rc;
935
922
936
- if (enable_async_client)
937
- return async_mysql_query_wrapper(mysql, query);
938
- else
939
- return mysql_query(mysql, query);
923
+ if (enable_async_client) return async_mysql_query_wrapper(mysql, query);
924
+ return mysql_query(mysql, query);
940
925
}
941
926
942
927
static int mysql_next_result_wrapper(MYSQL *mysql) {
943
- if (enable_async_client)
944
- return async_mysql_next_result_wrapper(mysql);
945
- else
946
- return mysql_next_result(mysql);
928
+ if (enable_async_client) return async_mysql_next_result_wrapper(mysql);
929
+ return mysql_next_result(mysql);
947
930
}
948
931
949
932
static MYSQL *mysql_real_connect_wrapper(MYSQL *mysql, const char *host,
@@ -954,16 +937,13 @@ static MYSQL *mysql_real_connect_wrapper(MYSQL *mysql, const char *host,
954
937
if (enable_async_client)
955
938
return async_mysql_real_connect_wrapper(mysql, host, user, passwd, db, port,
956
939
unix_socket, client_flag);
957
- else
958
- return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket,
959
- client_flag);
940
+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket,
941
+ client_flag);
960
942
}
961
943
962
944
static void mysql_free_result_wrapper(MYSQL_RES *result) {
963
- if (enable_async_client)
964
- return async_mysql_free_result_wrapper(result);
965
- else
966
- return mysql_free_result(result);
945
+ if (enable_async_client) return async_mysql_free_result_wrapper(result);
946
+ return mysql_free_result(result);
967
947
}
968
948
969
949
/* async client test code (end) */
@@ -5294,30 +5274,18 @@ static void check_variable_name(const char *var_name, const char *var_name_end,
5294
5274
op - character pointer to mathematical expression
5295
5275
*/
5296
5276
static bool is_operator(const char *op) {
5297
- if (*op == '+')
5298
- return true;
5299
- else if (*op == '-')
5300
- return true;
5301
- else if (*op == '*')
5302
- return true;
5303
- else if (*op == '/')
5304
- return true;
5305
- else if (*op == '%')
5306
- return true;
5307
- else if (*op == '&' && *(op + 1) == '&')
5308
- return true;
5309
- else if (*op == '|' && *(op + 1) == '|')
5310
- return true;
5311
- else if (*op == '&')
5312
- return true;
5313
- else if (*op == '|')
5314
- return true;
5315
- else if (*op == '^')
5316
- return true;
5317
- else if (*op == '>' && *(op + 1) == '>')
5318
- return true;
5319
- else if (*op == '<' && *(op + 1) == '<')
5320
- return true;
5277
+ if (*op == '+') return true;
5278
+ if (*op == '-') return true;
5279
+ if (*op == '*') return true;
5280
+ if (*op == '/') return true;
5281
+ if (*op == '%') return true;
5282
+ if (*op == '&' && *(op + 1) == '&') return true;
5283
+ if (*op == '|' && *(op + 1) == '|') return true;
5284
+ if (*op == '&') return true;
5285
+ if (*op == '|') return true;
5286
+ if (*op == '^') return true;
5287
+ if (*op == '>' && *(op + 1) == '>') return true;
5288
+ if (*op == '<' && *(op + 1) == '<') return true;
5321
5289
5322
5290
return false;
5323
5291
}
@@ -6141,18 +6109,17 @@ static void do_disable_warnings(struct st_command *command) {
6141
6109
// Set 'disable_warnings' property value to 1
6142
6110
set_property(command, P_WARN, true);
6143
6111
return;
6144
- } else {
6145
- // Parse the warning list argument specified with disable_warnings
6146
- // command.
6147
- parse_warning_list_argument(command);
6112
+ }
6113
+ // Parse the warning list argument specified with disable_warnings
6114
+ // command.
6115
+ parse_warning_list_argument(command);
6148
6116
6149
- // Update the environment variables containing the list of disabled
6150
- // and enabled warnings.
6151
- update_disabled_enabled_warnings_list_var();
6117
+ // Update the environment variables containing the list of disabled
6118
+ // and enabled warnings.
6119
+ update_disabled_enabled_warnings_list_var();
6152
6120
6153
- // Set 'disable_warnings' property value to 1
6154
- set_property(command, P_WARN, true);
6155
- }
6121
+ // Set 'disable_warnings' property value to 1
6122
+ set_property(command, P_WARN, true);
6156
6123
6157
6124
command->last_argument = command->end;
6158
6125
}
@@ -10920,10 +10887,8 @@ static struct st_replace_regex *init_replace_regex(const char *expr) {
10920
10887
}
10921
10888
10922
10889
if (p == expr_end || ++p == expr_end) {
10923
- if (!res->regex_arr.empty())
10924
- break;
10925
- else
10926
- goto err;
10890
+ if (!res->regex_arr.empty()) break;
10891
+ goto err;
10927
10892
}
10928
10893
/* we found the start */
10929
10894
reg.pattern = buf_p;
0 commit comments