summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-source-map.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-03 14:12:48 -0700
committerGitHub <noreply@github.com>2024-06-03 14:12:48 -0700
commit89c1fd0dd1581221f583653a9dfa6d1cf990577c (patch)
treefe5b1832bd64225ddf03c0146aec6f6057f607b8 /source/compiler-core/slang-source-map.cpp
parent68bf31e586b9d1805c19dd42492086c7c780c2a4 (diff)
Fix performance issue in source-map (#4261)
Diffstat (limited to 'source/compiler-core/slang-source-map.cpp')
-rw-r--r--source/compiler-core/slang-source-map.cpp2
1 files changed, 1 insertions, 1 deletions
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)