From 40aee538311d3a8bf82a0dc2112a1677e9479c66 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Sun, 23 Jun 2024 00:06:14 -0500 Subject: [PATCH] CLEANUP(contentmodel): Actually, no, I hate while loops --- components/contentselector/model/contentmodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index a1959d59f7..f8d6264a8d 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -674,8 +674,12 @@ void ContentSelectorModel::ContentModel::setNonUserContent(const QStringList& fi int insertPosition = 0; - while (insertPosition < mFiles.size() && mFiles.at(insertPosition)->builtIn()) + for (auto* file : mFiles) + { + if (!file->builtIn()) + break; ++insertPosition; + } for (const auto& filepath : fileList) {