Change for with count.

This commit is contained in:
Vasily Komrakov 2017-05-07 20:59:35 +03:00
commit 56540c893a
No known key found for this signature in database
GPG key ID: 558236680C20A69A
16 changed files with 73 additions and 73 deletions

View file

@ -130,7 +130,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
$tabledata_ary = DB()->sql_fetchrowset($result);
$dbsize = 0;
for ($i = 0; $i < count($tabledata_ary); $i++) {
for ($i = 0, $iMax = count($tabledata_ary); $i < $iMax; $i++) {
if (@$tabledata_ary[$i]['Type'] != 'MRG_MYISAM') {
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
}
@ -192,7 +192,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
if (count($onlinerow_reg)) {
$registered_users = $hidden_users = 0;
for ($i = 0, $cnt = count($onlinerow_reg); $i < $cnt; $i++) {
for ($i = 0, $iMax = count($onlinerow_reg); $i < $iMax; $i++) {
if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary)) {
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];
@ -226,7 +226,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
if (count($onlinerow_guest)) {
$guest_users = 0;
for ($i = 0; $i < count($onlinerow_guest); $i++) {
for ($i = 0, $iMax = count($onlinerow_guest); $i < $iMax; $i++) {
$guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
$guest_users++;
@ -263,7 +263,7 @@ print_page('index.tpl', 'admin');
// Functions
function inarray($needle, $haystack)
{
for ($i = 0; $i < count($haystack); $i++) {
for ($i = 0, $iMax = count($haystack); $i < $iMax; $i++) {
if ($haystack[$i] == $needle) {
return true;
}