internal static short[] DoPlacement(int nrow, int ncol) { int key = nrow * 1000 + ncol; short[] pc = (short[])cache[key]; if (pc != null) { return(pc); } Placement p = new Placement(); p.nrow = nrow; p.ncol = ncol; p.array = new short[nrow * ncol]; p.Ecc200(); cache[key] = p.array; return(p.array); }
internal static short[] DoPlacement(int nrow, int ncol) { int key = nrow * 1000 + ncol; lock (cache) { short[] pc; if (cache.TryGetValue(key, out pc)) return pc; } Placement p = new Placement(); p.nrow = nrow; p.ncol = ncol; p.array = new short[nrow * ncol]; p.Ecc200(); lock (cache) { cache[key] = p.array; } return p.array; }
internal static short[] DoPlacement(int nrow, int ncol) { int key = nrow * 1000 + ncol; short[] pc = (short[])cache[key]; if (pc != null) return pc; Placement p = new Placement(); p.nrow = nrow; p.ncol = ncol; p.array = new short[nrow * ncol]; p.Ecc200(); cache[key] = p.array; return p.array; }