From 137538a9942015af0ba92e36d2e544374339af75 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 1 Oct 2024 15:40:53 +0200 Subject: [PATCH] TextEditor: Spare unneeded lookups When deleting text marks from the cache we can safely assume that each mark is unique. This significantly reduces the time of cleaning up the marks cache when having lots of marks which may happen e.g. for Axivion analyses. Change-Id: I185cf0696cc603afb773d50fdfbaee84df9b2e20 Reviewed-by: David Schulz --- src/plugins/texteditor/textdocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index bf43ebc36e8..0f77c2568da 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -1034,7 +1034,7 @@ void TextDocument::removeMarkFromMarksCache(TextMark *mark) { auto documentLayout = qobject_cast(d->m_document.documentLayout()); QTC_ASSERT(documentLayout, return); - d->m_marksCache.removeAll(mark); + d->m_marksCache.removeOne(mark); auto scheduleLayoutUpdate = [documentLayout](){ // make sure all destructors that may directly or indirectly call this function are