yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.21k stars 165 forks source link

sources/console.c: cleanup redundant check condition #672

Closed chipitsine closed 2 months ago

chipitsine commented 3 months ago
*** CID 508676:  Incorrect expression  (IDENTICAL_BRANCHES) /sources/console.c: 301 in od_console_show_help()
295                     "\tSET key=arg\n"
296                     "\tCREATE <module_path>\n"
297                     "\tDROP SERVERS|MODULE <servers>|<module>";
298             stream = kiwi_be_write_notice_console_usage(stream, message);
299
300             int rc = kiwi_be_write_complete(stream, "SHOW", 5);
>>>     CID 508676:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>     The same code is executed when the condition "rc == -1" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
301             if (rc == NOT_OK_RESPONSE) {
302                     return rc;
303             }
304             return rc;
305     }
306