Skip to content

Commit

Permalink
Simplify array initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed May 6, 2014
1 parent 26df3b2 commit eba0952
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libraries/core.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,15 @@ function PMA_getRealSize($size = 0)
return 0;
}

$scan['gb'] = 1073741824; //1024 * 1024 * 1024;
$scan['g'] = 1073741824; //1024 * 1024 * 1024;
$scan['mb'] = 1048576;
$scan['m'] = 1048576;
$scan['kb'] = 1024;
$scan['k'] = 1024;
$scan['b'] = 1;
$scan = array(
'gb' => 1073741824, //1024 * 1024 * 1024,
'g' => 1073741824, //1024 * 1024 * 1024,
'mb' => 1048576,
'm' => 1048576,
'kb' => 1024,
'k' => 1024,
'b' => 1,
);

foreach ($scan as $unit => $factor) {
if (strlen($size) > strlen($unit)
Expand Down

0 comments on commit eba0952

Please sign in to comment.