At present sorting and expanding entries are side-effects of the
CheckEntries() function. This is a bit confusing, as 'checking' would
not normally involve making changes.
Move these steps into the Pack() function instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
def Pack(self, offset):
"""Pack all entries into the section"""
self._PackEntries()
+ if self._sort:
+ self._SortEntries()
+ self._ExpandEntries()
+
return super().Pack(offset)
def _PackEntries(self):
def CheckEntries(self):
"""Check that entries do not overlap or extend outside the section"""
- if self._sort:
- self._SortEntries()
- self._ExpandEntries()
offset = 0
prev_name = 'None'
for entry in self._entries.values():