mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Use the value of self.doc:getPages() stored in a local variable instead of calling it for each TOC entry.
This commit is contained in:
@@ -1744,7 +1744,7 @@ function UniReader:findTOCpos()
|
||||
|
||||
-- find the index into toc_xview first
|
||||
for k,v in ipairs(self.toc) do
|
||||
if v.page >= 1 and v.page <= self.doc:getPages() and v.page > self.pageno then
|
||||
if v.page >= 1 and v.page <= numpages and v.page > self.pageno then
|
||||
pos = k - 1
|
||||
found_pos = true
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user