public override sealed void Put(string name, BoxedValue value) { int index = 0; if (this.CanPut(name, out index)) { this.Properties[index].Value = value; this.Properties[index].HasValue = true; } }
public static SparseArray OfDense(Descriptor[] values) { var sparse = new SparseArray(); for (int i = 0; i < values.Length; i++) { if (values[i].HasValue) { uint num = (uint)i; sparse.storage[num] = values[i].Value; } } return sparse; }
private void ResizeDense(uint newCapacity) { var capacity = (uint)this.dense.Length; newCapacity = newCapacity == 0 ? 2 : newCapacity; var copyLength = newCapacity < capacity ? newCapacity : capacity; var newDense = new Descriptor[newCapacity]; Array.Copy(this.dense, newDense, copyLength); this.dense = newDense; }