/* * Executes a given callback passing the key of each row containing at least one element. */ public virtual void forEachRow(RowCallback <R, C, string> callback) { IEnumerator <R> iterator = this.matrix.Keys.GetEnumerator(); while (iterator.MoveNext()) { R row = iterator.Current; bool remove = callback.onRow(row, this.matrix[row]); if (remove) { this.matrix.Keys.Remove(row); } } }
/* * Executes a given callback passing the key of each row containing at least one element. */ public virtual void forEachRow(RowCallback <R, C, V> callback) { IEnumerator <R> iterator = this.matrix.Keys.GetEnumerator(); while (iterator.MoveNext()) { R row = iterator.Current; bool remove = callback.onRow(row, this.matrix[row]); if (remove) { ConcurrentDictionary <C, V> rowMap; this.matrix.TryRemove(row, out rowMap); } } }