From bc13c371e09010ccb97487cd6cdd5ecfb72365cb Mon Sep 17 00:00:00 2001 From: Matthew Wilkes Date: Tue, 19 Jun 2018 16:19:30 +0100 Subject: [PATCH] Improve performance of RecordsProxy.__iter__ --- CHANGES.rst | 4 +++- plone/registry/recordsproxy.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 862a57e..bfb876a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,7 +14,9 @@ New features: Bug fixes: -- *add item here* +- Improve performance of RecordsProxy.__iter__ which is now invoked more in + core Plone as part of the requireJS configuration + [MatthewWilkes] 1.1.2 (2016-12-06) diff --git a/plone/registry/recordsproxy.py b/plone/registry/recordsproxy.py index 58a541b..06c39ac 100644 --- a/plone/registry/recordsproxy.py +++ b/plone/registry/recordsproxy.py @@ -115,7 +115,7 @@ def __iter__(self): if '.' not in name: yield name else: - key = '.'.join(name.split('.')[:-1]) + key = name.rsplit('.', 1)[0] if key != last: yield key last = key