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:
Tigran Aivazian
2012-09-15 22:22:07 +01:00
parent 853f34b488
commit cc5abd3b87

View File

@@ -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