Skip to content

Commit fad8d51

Browse files
committed
fix(LogController): prevent iterator from jumping over the last item
- when requesting getLastItem(), logIteratorFactory->getLogIterator() creates a new LogIterator(), which in construct calls $this->rewind() -> $this->next(). So this should already return a last known line in the file, there is no need for $iterator->next() to be called again Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 1da32ea commit fad8d51

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/Controller/LogController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function get($query = '', $count = 50, $offset = 0): JSONResponse {
6969
*/
7070
private function getLastItem() {
7171
$iterator = $this->logIteratorFactory->getLogIterator($this->settingsService->getShownLevels());
72-
$iterator->next();
7372
return $iterator->current();
7473
}
7574

0 commit comments

Comments
 (0)