Catel.Fody.InstructionListExtensions.GetPreviousInstruction C# (CSharp) Method

GetPreviousInstruction() public static method

public static GetPreviousInstruction ( this instructions, Instruction instruction ) : Instruction
instructions this
instruction Mono.Cecil.Cil.Instruction
return Mono.Cecil.Cil.Instruction
        public static Instruction GetPreviousInstruction(this IList<Instruction> instructions, Instruction instruction)
        {
            var currentIndex = instructions.IndexOf(instruction);
            if (currentIndex <= 0)
            {
                return null;
            }

            return instructions[currentIndex - 1];
        }