private IEnumerable <int> _screen(SqlConnection conn, byte[] fp, int?next_after_storate_id, screenInBlockDelegate screenInBlockFunc) { // Find ones List <int> fp_ones = new List <int>(); for (int i = 0; i < _fp_bytes; i++) { byte b = fp[i]; for (int j = 0; j < 8; j++) { if ((b & (1 << j)) != 0) { fp_ones.Add(8 * i + j); } } } byte[] working_chunk1 = new byte[_chunk_bytes]; byte[] working_chunk2 = new byte[_chunk_bytes]; // Screen foreach (Block block in _all_blocks) { List <int> results = null; _validateBlockIndices(conn, block); results = screenInBlockFunc(fp_ones, block, working_chunk1, working_chunk2, conn); foreach (int index in results) { yield return(index); } } }
public IEnumerable <int> screenSub(SqlConnection conn, byte[] fp, int?next_after_storate_id) { screenInBlockDelegate screenBlockSub = new screenInBlockDelegate( (List <int> fp_ones, Block block, byte[] chunk, byte[] chunk2, SqlConnection conn2) => _screenInBlockSub(fp_ones, block, chunk, chunk2, conn2, next_after_storate_id)); return(_screen(conn, fp, next_after_storate_id, screenBlockSub)); }
private IEnumerable<int> _screen (SqlConnection conn, byte[] fp, int? next_after_storate_id, screenInBlockDelegate screenInBlockFunc) { // Find ones List<int> fp_ones = new List<int>(); for (int i = 0; i < _fp_bytes; i++) { byte b = fp[i]; for (int j = 0; j < 8; j++) if ((b & (1 << j)) != 0) fp_ones.Add(8 * i + j); } byte[] working_chunk1 = new byte[_chunk_bytes]; byte[] working_chunk2 = new byte[_chunk_bytes]; // Screen foreach (Block block in _all_blocks) { List<int> results = null; _validateBlockIndices(conn, block); results = screenInBlockFunc(fp_ones, block, working_chunk1, working_chunk2, conn); foreach (int index in results) yield return index; } }
public IEnumerable<int> screenSim (SqlConnection conn, byte[] fp, int? next_after_storate_id, getBoundsDelegate boundsDelegate) { screenInBlockDelegate screenBlockSim = new screenInBlockDelegate( (List<int> fp_ones, Block block, byte[] chunk, byte[] chunk2, SqlConnection conn2) => _screenInBlockSim(fp_ones, block, chunk, chunk2, conn2, boundsDelegate, next_after_storate_id)); return _screen(conn, fp, next_after_storate_id, screenBlockSim); }