public void Remove(Instruction instruction) { if (instruction == null) { throw new ArgumentNullException("instruction"); } if (!instructions.Remove(instruction)) { throw new ArgumentOutOfRangeException("instruction"); } }
public void Remove(Instruction instr) { if (!m_instrs.Contains(instr)) { throw new ArgumentException("Instruction not in method body"); } if (instr.Previous != null) { instr.Previous.Next = instr.Next; } if (instr.Next != null) { instr.Next.Previous = instr.Previous; } m_instrs.Remove(instr); }