MCPcopy Create free account
hub / github.com/apache/fory / AssignMetaStringIndexIfAbsent

Method AssignMetaStringIndexIfAbsent

csharp/src/Fory/WriteContext.cs:135–147  ·  view source on GitHub ↗
(MetaString value)

Source from the content-addressed store, hash-verified

133 }
134
135 internal (uint Index, bool IsNew) AssignMetaStringIndexIfAbsent(MetaString value)
136 {
137 if (_metaStringIndexByKey.TryGetValue(value, out uint existing))
138 {
139 return (existing, false);
140 }
141
142 uint index = _nextMetaStringIndex;
143 _nextMetaStringIndex += 1;
144 _metaStringIndexByKey[value] = index;
145 _hasMetaStringIndexes = true;
146 return (index, true);
147 }
148
149 internal void WriteTypeMeta(Type type, TypeMeta typeMeta)
150 {

Callers 1

WriteMetaStringMethod · 0.80

Calls 1

TryGetValueMethod · 0.45

Tested by

no test coverage detected