[improv]优化Packet.ToArray性能问题大石头 authored at 2024-09-11 09:04:36 大石头 committed at 2024-09-11 09:10:28
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();