From c2ab551badbfecb45e579c0be1569179a1d49dea Mon Sep 17 00:00:00 2001 From: av-dx Date: Fri, 13 Aug 2021 17:08:11 +0530 Subject: [PATCH] JANITORIAL: Add comments to explain assertion --- gui/widgets/groupedlist.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/widgets/groupedlist.cpp b/gui/widgets/groupedlist.cpp index 48a40e49f34..6d995f4d87a 100644 --- a/gui/widgets/groupedlist.cpp +++ b/gui/widgets/groupedlist.cpp @@ -73,6 +73,9 @@ void GroupedListWidget::setList(const U32StringArray &list, const ColorList *col void GroupedListWidget::setAttributeValues(const U32StringArray &attrValues) { _attributeValues = attrValues; + // Make sure we always have the attribute values for all the entries of the _dataList. + // This is not foolproof, but can prevent accidentally passing attributes for the wrong + // list of entries, such as after adding / removing games. if (!attrValues.empty()) assert(_attributeValues.size() == _dataList.size()); }