Icinga\Protocol\File\Reader::fetchPairs(): rename variables

$skipLines -> $skip
$readLines -> $read

refs #7060
This commit is contained in:
Alexander Klimov 2014-09-03 16:14:14 +02:00
parent 88dde47b7a
commit e45f50408a
1 changed files with 11 additions and 11 deletions

View File

@ -137,26 +137,26 @@ class Reader extends FilterIterator
*/ */
public function fetchPairs(Query $query) public function fetchPairs(Query $query)
{ {
$skipLines = $query->getOffset(); $skip = $query->getOffset();
$readLines = $query->getLimit(); $read = $query->getLimit();
if ($skipLines === null) { if ($skip === null) {
$skipLines = 0; $skip = 0;
} }
$lines = array(); $lines = array();
if ($query->sortDesc()) { if ($query->sortDesc()) {
$count = $this->count($query); $count = $this->count($query);
if ($count <= $skipLines) { if ($count <= $skip) {
return $lines; return $lines;
} else if ($count < ($skipLines + $readLines)) { } else if ($count < ($skip + $read)) {
$readLines = $count - $skipLines; $read = $count - $skip;
$skipLines = 0; $skip = 0;
} else { } else {
$skipLines = $count - ($skipLines + $readLines); $skip = $count - ($skip + $read);
} }
} }
foreach ($this as $index => $line) { foreach ($this as $index => $line) {
if ($index >= $skipLines) { if ($index >= $skip) {
if ($index >= $skipLines + $readLines) { if ($index >= $skip + $read) {
break; break;
} }
$lines[] = $line; $lines[] = $line;