make some struct properties readonly

This commit is contained in:
Jim Horvath 2024-02-17 15:40:59 -05:00
parent caa4e6d1e6
commit abc0dcf72c
2 changed files with 5 additions and 5 deletions

View file

@ -12,12 +12,12 @@ namespace Ryujinx.Memory.Range
_enumerator = new PagedMemoryRangeEnumerator(startAddress, size, pageSize, mapAddress);
}
public MemoryRange Current => _current!.Value;
public readonly MemoryRange Current => _current!.Value;
/// <summary>
/// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop.
/// </summary>
public PagedMemoryRangeCoalescingEnumerator GetEnumerator() => this;
public readonly PagedMemoryRangeCoalescingEnumerator GetEnumerator() => this;
public bool MoveNext()
{

View file

@ -22,14 +22,14 @@ namespace Ryujinx.Memory.Range
_offset = 0;
}
public MemoryRange Current => _current!.Value;
public readonly MemoryRange Current => _current!.Value;
internal bool HasCurrent => _current.HasValue;
internal readonly bool HasCurrent => _current.HasValue;
/// <summary>
/// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop.
/// </summary>
public PagedMemoryRangeEnumerator GetEnumerator() => this;
public readonly PagedMemoryRangeEnumerator GetEnumerator() => this;
public bool MoveNext()
{