/// <summary>Moves all labels from a different code instruction to the current one</summary> /// <param name="code">The <see cref="CodeInstruction"/> to move the labels from</param> /// <param name="other">The <see cref="CodeInstruction"/> to move the labels to</param> /// <returns>The code instruction that received the labels</returns> public static CodeInstruction MoveLabelsFrom(this CodeInstruction code, CodeInstruction other) { return(code.WithLabels(other.ExtractLabels())); }
/// <summary>Moves all labels from the code instruction to a different one</summary> /// <param name="code">The <see cref="CodeInstruction"/> to move the labels from</param> /// <param name="other">The <see cref="CodeInstruction"/> to move the labels to</param> /// <returns>The code instruction labels were moved from (now empty)</returns> public static CodeInstruction MoveLabelsTo(this CodeInstruction code, CodeInstruction other) { other.WithLabels(code.ExtractLabels()); return(code); }