From 89c1fd0dd1581221f583653a9dfa6d1cf990577c Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 3 Jun 2024 14:12:48 -0700 Subject: Fix performance issue in source-map (#4261) --- source/compiler-core/slang-source-map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/compiler-core/slang-source-map.cpp') diff --git a/source/compiler-core/slang-source-map.cpp b/source/compiler-core/slang-source-map.cpp index 43727838f..533c6bde0 100644 --- a/source/compiler-core/slang-source-map.cpp +++ b/source/compiler-core/slang-source-map.cpp @@ -148,7 +148,7 @@ void SourceMap::advanceToLine(Index nextLineIndex) const auto lastEntryIndex = m_lineEntries.getCount(); // For all the new entries they will need to point to the end - m_lineStarts.setCount(nextLineIndex + 1); + m_lineStarts.growToCount(nextLineIndex + 1); Index* starts = m_lineStarts.getBuffer(); for (Index i = currentLineIndex + 1; i < nextLineIndex + 1; ++i) -- cgit v1.2.3