diff options
author | vnugent <public@vaughnnugent.com> | 2023-07-28 11:59:28 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-07-28 11:59:28 -0400 |
commit | f0c2337358fc43ad9c79294c539c4ddec4280011 (patch) | |
tree | 3125d7fece381c0ab86012bc0b1c848fee0170eb /lib/Utils/src/Extensions | |
parent | cd7d9f3ec65737b96c713b1b84ef972e901c4ea3 (diff) |
Compressor control refactor, reduce copy
Diffstat (limited to 'lib/Utils/src/Extensions')
-rw-r--r-- | lib/Utils/src/Extensions/IoExtensions.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Utils/src/Extensions/IoExtensions.cs b/lib/Utils/src/Extensions/IoExtensions.cs index 637cfab..bcbe810 100644 --- a/lib/Utils/src/Extensions/IoExtensions.cs +++ b/lib/Utils/src/Extensions/IoExtensions.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Utils @@ -328,12 +328,11 @@ namespace VNLib.Utils.Extensions * bytes from the source */ long total = 0; - int bufferSize = buffer.Length; int read; while (true) { //get offset wrapper of the total buffer or remaining count - Memory<byte> offset = buffer[..(int)Math.Min(bufferSize, count - total)]; + Memory<byte> offset = buffer[..(int)Math.Min(buffer.Length, count - total)]; //read read = await source.ReadAsync(offset, token); //Guard |