Skip to content

Commit

Permalink
Move to foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Sep 10, 2019
1 parent b57256a commit 63982ed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions perfdata-purge
Expand Up @@ -7,8 +7,7 @@

$perfdata = new SplFileObject($file);
$counter = 0;
while (!$perfdata->eof()) {
$line = $perfdata->fgets();
foreach ($perfdata as $line) {
$tmp = explode('||',$line);
$timestamp = intval($tmp[0]);
if ($timestamp < strtotime($cutoff . ' days ago')) {
Expand Down

0 comments on commit 63982ed

Please sign in to comment.