public void Clear() { for (int x = 0; x < size; x++) { tabledata[x] = new TTHashEntry(); } }
public bool Lookup(UInt64 hashcode, ref TTHashEntry hash) { long groupStart = (long)hashcode & (size - 1) & 0xFFFFFFFCL; for (int slot = 0; slot < 4; slot++) { if (tabledata[groupStart + slot].CheckHash(hashcode)) { hash = tabledata[groupStart + slot]; return(true); } } return(false); }
protected bool allocate(int size) { int arraySize = size * 4; try { tabledata = new TTHashEntry[arraySize]; } catch (OutOfMemoryException ex) { return(false); } catch (Exception ex) { throw ex; } this.size = arraySize; return(true); }