Code optimization for my_disk function

This commit is contained in:
bergware
2016-08-05 20:32:24 +02:00
parent 4e563be00a
commit 56b7f7ad37
+1 -1
View File
@@ -49,7 +49,7 @@ function my_temp($value) {
return is_numeric($value) ? (($unit=='C' ? str_replace('.', $number[0], $value) : round(9/5*$value+32))." $unit") : $value;
}
function my_disk($name) {
return ucfirst(preg_replace(array('/^(parity|disk|cache)([0-9]+)/','/^parity,cache,disk/'),array('$1 $2','Parity, Cache, Disk '),$name));
return ucfirst(preg_replace('/(\d+)/',' $1',$name));
}
function my_disks($disk) {
return strpos($disk['status'],'_NP')===false;