public HashList Set(Object key, Object value) { HashList result = this; if (result.mNext != result) { result = MakeCopy(); } result.mDict[key] = value; return(result); }
public HashList Add(Object key, Object value) { HashList result = this; if (result.mNext != result) { result = MakeCopy(); } result.mDict.Add(key, value); return(result); }
private HashList MakeCopy() { HashList result = new HashList(); result.mDict = new Dictionary<object, object>(mDict); HashList next = mNext; while (next != this) { // Remove "this" from the reference chain if (next.mNext == this) next.mNext = this.mNext; } return result; }
private HashList MakeCopy() { HashList result = new HashList(); result.mDict = new Dictionary <object, object>(mDict); HashList next = mNext; while (next != this) { // Remove "this" from the reference chain if (next.mNext == this) { next.mNext = this.mNext; } } return(result); }
private HashList(HashList list) { mDict = list.mDict; mNext = list.mNext; list.mNext = this; }
public HashList() { mNext = this; }