Skip to content

Commit df8f29e

Browse files
committed
Fix IDE0250 (struct can be made readonly)
1 parent 3702982 commit df8f29e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/libraries/System.Private.CoreLib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void ICollection.CopyTo(Array array, int index)
211211

212212
object ICollection.SyncRoot => (m_dictionary is ICollection coll) ? coll.SyncRoot : this;
213213

214-
private struct DictionaryEnumerator : IDictionaryEnumerator
214+
private readonly struct DictionaryEnumerator : IDictionaryEnumerator
215215
{
216216
private readonly IDictionary<TKey, TValue> _dictionary;
217217
private readonly IEnumerator<KeyValuePair<TKey, TValue>> _enumerator;

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal struct EventPipeSessionInfo
2929
}
3030

3131
[StructLayout(LayoutKind.Sequential)]
32-
internal struct EventPipeProviderConfiguration
32+
internal readonly struct EventPipeProviderConfiguration
3333
{
3434
[MarshalAs(UnmanagedType.LPWStr)]
3535
private readonly string m_providerName;

src/libraries/System.Private.CoreLib/src/System/Threading/ReaderWriterLockSlim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public void EnterReadLock()
230230
//
231231
// Common timeout support
232232
//
233-
private struct TimeoutTracker
233+
private readonly struct TimeoutTracker
234234
{
235235
private readonly int _total;
236236
private readonly int _start;

0 commit comments

Comments
 (0)