forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -1034,7 +1034,7 @@ void TextDocument::removeMarkFromMarksCache(TextMark *mark)
|
|||||||
{
|
{
|
||||||
auto documentLayout = qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
|
auto documentLayout = qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
d->m_marksCache.removeAll(mark);
|
d->m_marksCache.removeOne(mark);
|
||||||
|
|
||||||
auto scheduleLayoutUpdate = [documentLayout](){
|
auto scheduleLayoutUpdate = [documentLayout](){
|
||||||
// make sure all destructors that may directly or indirectly call this function are
|
// make sure all destructors that may directly or indirectly call this function are
|
||||||
|
Reference in New Issue
Block a user