瀏覽代碼

Merge pull request #880 from xljiulang/master

Reduce the performance cost of Memory<T>.getSpan()
release/3.x.x
Christian 4 年之前
committed by GitHub
父節點
當前提交
dca2af47d8
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      Source/MQTTnet.AspnetCore/Extensions/ReaderExtensions.cs

+ 2
- 2
Source/MQTTnet.AspnetCore/Extensions/ReaderExtensions.cs 查看文件

@@ -80,7 +80,7 @@ namespace MQTTnet.AspNetCore
headerLength = 0;
bodyLength = 0;
var temp = input.Slice(0, Math.Min(5, input.Length)).GetMemory();
var temp = input.Slice(0, Math.Min(5, input.Length)).GetMemory().Span;

do
{
@@ -88,7 +88,7 @@ namespace MQTTnet.AspNetCore
{
return false;
}
encodedByte = temp.Span[index];
encodedByte = temp[index];
index++;

value += (byte)(encodedByte & 127) * multiplier;


Loading…
取消
儲存