Mercurial > piecrust2
changeset 985:74f4bde40fd0
data: Optimize page data so cheapest accessors are tried first.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 31 Oct 2017 09:28:35 -0700 |
parents | e7ca3c577305 |
children | ef224cce343c |
files | piecrust/data/builder.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/data/builder.py Mon Oct 30 19:23:10 2017 -0700 +++ b/piecrust/data/builder.py Tue Oct 31 09:28:35 2017 -0700 @@ -64,7 +64,11 @@ site_data = app.config.getAll() providers_data = DataProvidersData(page) - data = MergedMapping([data, providers_data, site_data]) + + # Put the site data first so that `MergedMapping` doesn't load stuff + # for nothing just to find a value that was in the YAML config all + # along. + data = MergedMapping([site_data, data, providers_data]) # Do this at the end because we want all the data to be ready to be # displayed in the debugger window.