我正在尝试使用更有效的代码。
我有以下代码:
if (currentHexCode == "00")
{
x = 1;
setLocationForNewInstruction(currentLine);
_channelLinesPreFiltered[currentLine].SetTriplet();
}
else if (currentHexCode == "01")
{
x = 1;
setLocationForNewInstruction(currentLine);
_channelLinesPreFiltered[currentLine].SetConnect();
}
// and some more
我想执行以下操作:
x = 1;
setLocationForNewInstruction(currentLine);
call SetTriplet or SetConnect;, the one that I would pass as a parameter
我无法在if之外做指令,我真正想要的是具有执行此操作的功能。