From 67b4e63cff0d6ce9629c3032f2b0d6414cee1220 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 19 Mar 2023 13:31:35 -0300 Subject: Remove MultiRange Min/MaxAddress and rename GetSlice to Slice (#4566) * Delete MinAddress and MaxAddress from MultiRange * Rename MultiRange.GetSlice to MultiRange.Slice --- Ryujinx.Memory/Range/MultiRange.cs | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'Ryujinx.Memory/Range/MultiRange.cs') diff --git a/Ryujinx.Memory/Range/MultiRange.cs b/Ryujinx.Memory/Range/MultiRange.cs index dc2aefe4..9dbd76ec 100644 --- a/Ryujinx.Memory/Range/MultiRange.cs +++ b/Ryujinx.Memory/Range/MultiRange.cs @@ -20,16 +20,6 @@ namespace Ryujinx.Memory.Range /// public int Count => HasSingleRange ? 1 : _ranges.Length; - /// - /// Minimum start address of all sub-ranges. - /// - public ulong MinAddress { get; } - - /// - /// Maximum end address of all sub-ranges. - /// - public ulong MaxAddress { get; } - /// /// Creates a new multi-range with a single physical region. /// @@ -39,8 +29,6 @@ namespace Ryujinx.Memory.Range { _singleRange = new MemoryRange(address, size); _ranges = null; - MinAddress = address; - MaxAddress = address + size; } /// @@ -52,30 +40,6 @@ namespace Ryujinx.Memory.Range { _singleRange = MemoryRange.Empty; _ranges = ranges ?? throw new ArgumentNullException(nameof(ranges)); - - if (ranges.Length != 0) - { - MinAddress = ulong.MaxValue; - MaxAddress = 0UL; - - foreach (MemoryRange range in ranges) - { - if (MinAddress > range.Address) - { - MinAddress = range.Address; - } - - if (MaxAddress < range.EndAddress) - { - MaxAddress = range.EndAddress; - } - } - } - else - { - MinAddress = 0UL; - MaxAddress = 0UL; - } } /// @@ -84,7 +48,7 @@ namespace Ryujinx.Memory.Range /// Offset of the slice into the multi-range in bytes /// Size of the slice in bytes /// A new multi-range representing the given slice of this one - public MultiRange GetSlice(ulong offset, ulong size) + public MultiRange Slice(ulong offset, ulong size) { if (HasSingleRange) { -- cgit v1.2.3