public void ContainKey() { var d = new DictionarySlim <ulong, int>(); d.GetOrAddValueRef(7) = 9; d.GetOrAddValueRef(10) = 10; Assert.True(d.ContainsKey(7)); Assert.True(d.ContainsKey(10)); Assert.False(d.ContainsKey(1)); }
private void FindAndResolveLabels(Match match) //when a label is found, substitutes all instances of this label with the equivalent 8085 memory address { if (labels.ContainsKey(match.Groups["label"].Value)) { errors_list.Add(new AssembleError($"Label {match.Groups["label"].Value} was previously defined", line_number)); } else { labels.GetOrAddValueRef(match.Groups["label"].Value) = counter; if (to_be_resolved.TryGetValue(match.Groups["label"].Value, out IReadOnlyCollection <KeyValuePair <ushort, int> > address_line)) { byte[] address_bytes = BitConverter.GetBytes(counter); foreach (KeyValuePair <ushort, int> item in address_line) { temp_memory[item.Key] = address_bytes[0]; temp_memory[item.Key + 1] = address_bytes[1]; } to_be_resolved.Remove(match.Groups["label"].Value); } } }
public void DictionarySlimContainsKey() => dictionarySlim.ContainsKey(value);