Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryLookup()

bool System.Xml.XmlBinaryWriterSession.TryLookup ( XmlDictionaryString s,
out int key )
inlinepackage

Definition at line 220 of file XmlBinaryWriterSession.cs.

221 {
222 if (_maps.TryGetValue(s.Dictionary, out var value))
223 {
224 key = value[s.Key] - 1;
225 if (key != -1)
226 {
227 return true;
228 }
229 }
230 if (_strings.TryGetValue(s.Value, out key))
231 {
232 if (value == null)
233 {
234 value = AddKeys(s.Dictionary, s.Key + 1);
235 }
236 value[s.Key] = key + 1;
237 return true;
238 }
239 key = -1;
240 return false;
241 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool TryGetValue(K key, [MaybeNullWhen(false)] out V value)
readonly PriorityDictionary< IXmlDictionary, IntArray > _maps
IntArray AddKeys(IXmlDictionary dictionary, int minCount)
readonly PriorityDictionary< string, int > _strings

References System.Xml.XmlBinaryWriterSession._maps, System.Xml.XmlBinaryWriterSession._strings, System.Xml.XmlBinaryWriterSession.AddKeys(), System.key, System.s, System.Xml.XmlBinaryWriterSession.PriorityDictionary< K, V >.TryGetValue(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Xml.XmlBinaryNodeWriter.TryGetKey().