simplify further

Wed, 25 May 2022 17:47:06 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 25 May 2022 17:47:06 +0300
changeset 194
be056e87c8ca
parent 193
b4beff48bb7a
child 195
6e79c1cb83e6

simplify further

src/documentmanager.cpp file | annotate | diff | comparison | revisions
--- a/src/documentmanager.cpp	Wed May 25 17:42:02 2022 +0300
+++ b/src/documentmanager.cpp	Wed May 25 17:47:06 2022 +0300
@@ -380,11 +380,9 @@
 void DocumentManager::modelModified()
 {
 	Model* model = qobject_cast<Model*>(this->sender());
-	for (auto it = this->openModels.begin(); it != this->openModels.end(); ++it) {
-		if (model == it->second.model.get()) {
-			this->polygonCaches[it->second.id].needRecache = true;
-			break;
-		}
+	const std::optional<ModelId> modelId = this->findIdForModel(model);
+	if (modelId.has_value()) {
+		this->polygonCaches[*modelId].needRecache = true;
 	}
 }
 

mercurial