From bcf57cd68a80d096a2d30b0185864613da20c09e Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 5 May 2017 00:52:25 +0300 Subject: [PATCH] If-return-return could be simplified. --- library/attach_mod/includes/functions_attach.php | 6 +----- library/includes/functions_torrent.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index 106d42404..5dac8ccc6 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -454,11 +454,7 @@ function user_in_group($user_id, $group_id) $num_rows = DB()->num_rows($result); DB()->sql_freeresult($result); - if ($num_rows == 0) { - return false; - } - - return true; + return !($num_rows == 0); } /** diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 7d7a11f88..4cb1b9ae6 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -624,11 +624,7 @@ function ocelot_update_tracker($action, $updates) $max_attempts = 3; $err = false; - if (ocelot_send_request($get, $max_attempts, $err) === false) { - return false; - } - - return true; + return !(ocelot_send_request($get, $max_attempts, $err) === false); } function ocelot_send_request($get, $max_attempts = 1, &$err = false)