summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-name.cpp
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-07-17 07:57:42 +0000
committerGitHub <noreply@github.com>2025-07-17 07:57:42 +0000
commit3485710e93d833a1c7b691af707cfd8962af7d17 (patch)
tree5a45f60da92aed422a923b4f62ad3ffa3a10db65 /source/compiler-core/slang-name.cpp
parent28758e0e427ceca196937dc90efe3ab1cb35bd70 (diff)
Merge NamePool and RootNamePool into a single type (#7797)
* Initial plan * Merge NamePool and RootNamePool into single NamePool class Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove unnecessary comment from slang-fiddle-scrape.cpp Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com> * Address review feedback: initialize namePool to nullptr and remove unnecessary comments Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Theresa Foley <tangent-vector@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/compiler-core/slang-name.cpp')
-rw-r--r--source/compiler-core/slang-name.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/compiler-core/slang-name.cpp b/source/compiler-core/slang-name.cpp
index 6f79d25b5..da19dfe3b 100644
--- a/source/compiler-core/slang-name.cpp
+++ b/source/compiler-core/slang-name.cpp
@@ -24,12 +24,12 @@ const char* getCstr(Name* name)
Name* NamePool::getName(UnownedStringSlice text)
{
RefPtr<Name> name;
- if (rootPool->names.tryGetValue(text, name))
+ if (names.tryGetValue(text, name))
return name;
name = new Name();
name->text = text;
- rootPool->names.add(text, name);
+ names.add(text, name);
return name;
}
@@ -41,7 +41,7 @@ Name* NamePool::getName(String const& text)
Name* NamePool::tryGetName(String const& text)
{
RefPtr<Name> name;
- if (rootPool->names.tryGetValue(text, name))
+ if (names.tryGetValue(text, name))
return name;
return nullptr;
}