The branch, master has been updated via c1f536637b6d7a8b8a5bacef6baa4f779100942d (commit) via 5951117ea1ab526ff64afd3e21323c975c22b312 (commit) from 9978dddea23153eaa11e03c1c7145729a5e58229 (commit)
- Log ----------------------------------------------------------------- commit c1f536637b6d7a8b8a5bacef6baa4f779100942d Author: Michal Čihař michal@cihar.com Date: Thu Apr 22 20:25:13 2010 +0200
All logic can be done in single if.
We should also check if [0] element is set.
commit 5951117ea1ab526ff64afd3e21323c975c22b312 Author: Michal Čihař michal@cihar.com Date: Thu Apr 22 20:23:45 2010 +0200
These values are initialized to 0, no need to explicitely reset them.
-----------------------------------------------------------------------
Summary of changes: server_synchronize.php | 22 ++++++---------------- 1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/server_synchronize.php b/server_synchronize.php index b263ba2..afa7cce 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -288,26 +288,16 @@ if ((isset($_REQUEST['submit_connect']))) { /** * Calculating the number of updates for each matching table */ - if (isset($update_array[$i])) { - if (isset($update_array[$i][0][$matching_tables_keys[$i][0]])) { - $num_of_updates = sizeof($update_array[$i]); - } else { - $num_of_updates = 0; - } - } else { - $num_of_updates = 0; + if (isset($update_array[$i]) && isset($update_array[$i][0]) && + isset($update_array[$i][0][$matching_tables_keys[$i][0]])) { + $num_of_updates = sizeof($update_array[$i]); } /** * Calculating the number of insertions for each matching table */ - if (isset($insert_array[$i])) { - if (isset($insert_array[$i][0][$matching_tables_keys[$i][0]])) { - $num_of_insertions = sizeof($insert_array[$i]); - } else { - $num_of_insertions = 0; - } - } else { - $num_of_insertions = 0; + if (isset($insert_array[$i]) && isset($insert_array[$i][0]) && + isset($insert_array[$i][0][$matching_tables_keys[$i][0]])) { + $num_of_insertions = sizeof($insert_array[$i]); } /** * Displays the name of the matching table
hooks/post-receive