refactor: simplify code without changing behavior

This commit is contained in:
Fonata
2021-11-07 12:37:29 +01:00
committed by Fonata
parent 009820d190
commit a28fc6ab0a

View File

@@ -1248,7 +1248,7 @@ class Csv {
$first = null;
$equal = null;
$almost = false;
foreach ($array as $key => $value) {
foreach ($array as $value) {
if ($first == null) {
$first = $value;
} elseif ($value == $first && $equal !== false) {
@@ -1405,7 +1405,7 @@ class Csv {
$is_newline = ($ch == "\n" && $pch != "\r") || $ch == "\r";
if ($ch == $enclosure) {
if (!$enclosed || $nch != $enclosure) {
$enclosed = $enclosed ? false : true;
$enclosed = !$enclosed;
} elseif ($enclosed) {
$i++;
}