NewLife/X

[improv]优化Packet.ToArray性能问题
大石头 authored at 2024-09-11 09:04:36 大石头 committed at 2024-09-11 09:10:28
8e00f75
Tree
1 Parent(s) e76e75e
Summary: 1 changed files with 1 additions and 1 deletions.
Modified +1 -1
Modified +1 -1
diff --git a/NewLife.Core/Data/Packet.cs b/NewLife.Core/Data/Packet.cs
index 7f06504..51e7918 100644
--- a/NewLife.Core/Data/Packet.cs
+++ b/NewLife.Core/Data/Packet.cs
@@ -257,7 +257,7 @@ public class Packet
     {
         //if (Offset == 0 && (Count < 0 || Offset + Count == Data.Length) && Next == null) return Data;
 
-        if (Next == null) Data.ReadBytes(Offset, Count);
+        if (Next == null) return Data.ReadBytes(Offset, Count);
 
         // 链式包输出
         var ms = Pool.MemoryStream.Get();