mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
performance: Cache some properties
This commit is contained in:
parent
3f27e92eb0
commit
402677f687
2 changed files with 13 additions and 9 deletions
|
@ -17,6 +17,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from functools import cached_property
|
||||
|
||||
from .. import gir
|
||||
from .imports import GtkDirective, Import
|
||||
|
@ -82,7 +83,7 @@ class UI(AstNode):
|
|||
or isinstance(child, Menu)
|
||||
]
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def objects_by_id(self):
|
||||
return {
|
||||
obj.tokens["id"]: obj
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue