2017-08-02 36 views
9

optimize:RyuJIT C# yanlış toplamı sonucu/I kod parçası ettik

private void AnswerToCe(int currentBlock, int totalBlock = 0) 
{ 
    byte[] bufferToSend; 
    byte[] macDst = mac; 
    byte[] macSrc = ConnectionManager.SInstance.GetMyMAC(); 
    byte[] ethType; 
    byte[] header; 

    if (Function == FlashFunction.UPLOAD_APPL || Function == FlashFunction.UPLOAD_BITSTREAM) 
    { 
     ethType = BitConverter.GetBytes((ushort)EthType.ETH_TYPE_UPLOAD); 
     ethType = new byte[] { ethType[1], ethType[0] }; 
     header = Header.GetBytes((ushort)binaryBlocks.Count, (ushort)(currentBlock + 1), (ushort)binaryBlocks[currentBlock].Length); 
     int index = 0; 
     bufferToSend = new byte[macDst.Length + macSrc.Length + ethType.Length + header.Length + binaryBlocks[currentBlock].Length]; 
     Array.Copy(macDst, 0, bufferToSend, index, macDst.Length); 
     index += macDst.Length; 
     Array.Copy(macSrc, 0, bufferToSend, index, macSrc.Length); 
     index += macSrc.Length; 
     Logger.SInstance.Write(index.ToString(),