mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 00:36:38 +00:00
refactor: simplify code without changing behavior
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user