Performance fix in _findBookmark(), some comments.
This commit is contained in:
parent
3ab19d5f37
commit
645b057d49
|
|
@ -119,6 +119,7 @@ class Bookmarks(object):
|
|||
return result
|
||||
|
||||
def getEditableBookmarks(self):
|
||||
# Only return bookmarks that can be saved
|
||||
self._refresh()
|
||||
return [b for b in self.bookmarks if b.srcFile is None]
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
|
|||
def _findBookmark(self, bookmark_id):
|
||||
bookmarks = Bookmarks.getSharedInstance()
|
||||
try:
|
||||
return next(b for b in bookmarks.getEditableBookmarks() if id(b) == bookmark_id)
|
||||
return next(b for b in bookmarks.getBookmarks() if id(b) == bookmark_id)
|
||||
except StopIteration:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue