Mosa.Compiler.Framework.InstructionNode.ReplaceOperands C# (CSharp) Method

ReplaceOperands() private method

private ReplaceOperands ( Operand target, Operand replacement ) : void
target Operand
replacement Operand
return void
        private void ReplaceOperands(Operand target, Operand replacement)
        {
            for (int i = 0; i < OperandCount; i++)
            {
                var operand = GetOperand(i);

                if (target == operand)
                {
                    SetOperand(i, replacement);
                }
            }

            for (int i = 0; i < ResultCount; i++)
            {
                var operand = GetResult(i);

                if (target == operand)
                {
                    SetResult(i, replacement);
                }
            }
        }