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

◆ Get()

static Regex System.Text.RegularExpressions.RegexCache.Get ( Key key)
inlinestaticprivate

Definition at line 141 of file RegexCache.cs.

142 {
143 long num = 0L;
145 if (node != null)
146 {
147 if (key.Equals(node.Key))
148 {
149 return node.Regex;
150 }
151 num = Volatile.Read(ref node.LastAccessStamp);
152 }
153 if (s_maxCacheSize != 0 && s_cacheDictionary.TryGetValue(key, out var value))
154 {
155 Volatile.Write(ref value.LastAccessStamp, num + 1);
157 return value.Regex;
158 }
159 return null;
160 }
static readonly ConcurrentDictionary< Key, Node > s_cacheDictionary
Definition RegexCache.cs:70
static bool Read(ref bool location)
Definition Volatile.cs:67
static void Write(ref bool location, bool value)
Definition Volatile.cs:74

References System.key, System.L, System.Threading.Volatile.Read(), System.Text.RegularExpressions.RegexCache.s_cacheDictionary, System.Text.RegularExpressions.RegexCache.s_lastAccessed, System.Text.RegularExpressions.RegexCache.s_maxCacheSize, System.Text.RegularExpressions.value, and System.Threading.Volatile.Write().

Referenced by System.Text.RegularExpressions.RegexCache.GetOrAdd(), and System.Text.RegularExpressions.RegexCache.GetOrAdd().