public void TrimToSize() { if (n < arr.Length) { byte[] aux = new byte[n]; Array.Copy(arr, 0, aux, 0, n); arr = aux; } } }
public void LoadSimplePatterns(Stream stream) { SimplePatternParser pp = new SimplePatternParser(); ivalues = new TernaryTree(); pp.Parse(stream, this); // patterns/values should be now in the tree // let's optimize a bit TrimToSize(); vspace.TrimToSize(); classmap.TrimToSize(); // get rid of the auxiliary map ivalues = null; }