summaryrefslogtreecommitdiffstats
path: root/source/core/slang-string-slice-pool.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-19 17:06:56 -0400
committerGitHub <noreply@github.com>2023-04-19 17:06:56 -0400
commit588991f6df3d6813378721166a7260990835817e (patch)
treefca8c57fedb1967af20ca2da50bbd7dc8afc6a07 /source/core/slang-string-slice-pool.cpp
parent520a3c064c42e8cd50ef4fde21539870d5b19cb7 (diff)
Make SourceMap a value type (#2812)
* #include an absolute path didn't work - because paths were taken to always be relative. * Moved JSON source map writing logic to JSONSourceMapUtil. * Use ArtifactHandler to read/write SourceMaps. Use ObjectCastableAdapter to hold SourceMap Only serialize SourceMap <-> JSON on demand. * Make some types swappable. * BoxValue impl. * Added asBoxValue. * Remove const get funcs. * Fix typo in asBoxValue. * Fix another typo in asBoxValue. * Slightly simplify conversion to blob of SourceMap. * Small fix for asBoxValue
Diffstat (limited to 'source/core/slang-string-slice-pool.cpp')
-rw-r--r--source/core/slang-string-slice-pool.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/core/slang-string-slice-pool.cpp b/source/core/slang-string-slice-pool.cpp
index a0af3ba68..45cc811a3 100644
--- a/source/core/slang-string-slice-pool.cpp
+++ b/source/core/slang-string-slice-pool.cpp
@@ -41,6 +41,14 @@ void StringSlicePool::clear()
}
}
+void StringSlicePool::swapWith(ThisType& rhs)
+{
+ Swap(m_style, rhs.m_style);
+ m_slices.swapWith(rhs.m_slices);
+ m_map.swapWith(rhs.m_map);
+ m_arena.swapWith(rhs.m_arena);
+}
+
StringSlicePool::Handle StringSlicePool::add(const Slice& slice)
{
const Handle* handlePtr = m_map.TryGetValue(slice);