浏览代码

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;


正在加载...
取消
保存