Mono.Cecil.Cil.CodeReader.ResolveBranches C# (CSharp) Method

ResolveBranches() private method

private ResolveBranches ( Collection instructions ) : void
instructions Collection
return void
        void ResolveBranches(Collection<Instruction> instructions)
        {
            var items = instructions.items;
            var size = instructions.size;

            for (int i = 0; i < size; i++) {
                var instruction = items [i];
                switch (instruction.opcode.OperandType) {
                case OperandType.ShortInlineBrTarget:
                case OperandType.InlineBrTarget:
                    instruction.operand = GetInstruction ((int) instruction.operand);
                    break;
                case OperandType.InlineSwitch:
                    var offsets = (int []) instruction.operand;
                    var branches = new Instruction [offsets.Length];
                    for (int j = 0; j < offsets.Length; j++)
                        branches [j] = GetInstruction (offsets [j]);

                    instruction.operand = branches;
                    break;
                }
            }
        }