Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CopyTo(arr) instead of creating List<T> first #36228

Merged
merged 5 commits into from
May 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using StructLayoutAttribute = System.Runtime.InteropServices.StructLayoutAttribute;

namespace System.Reflection.TypeLoading
Expand Down Expand Up @@ -192,9 +193,7 @@ private RoType[] ComputeInterfaceClosure()
}
}

// todo: use IEnumerable<T> extension: return ifcs.ToArray()
List<RoType> list = new List<RoType>(ifcs);
return list.ToArray();
return ifcs.ToArray();
Youssef1313 marked this conversation as resolved.
Show resolved Hide resolved
}

private volatile RoType[]? _lazyInterfaces;
Expand Down