Repository navigation
Remove usage of LINQ from the metadata writer - #1095
Conversation
| @@ -0,0 +1,74 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
| // The .NET Foundation licenses this file to you under the MIT license. | |||
There was a problem hiding this comment.
Should this live under common like all other LowLevel*.cs?
There was a problem hiding this comment.
Then I would need to invent a neutrally sounding namespace for it, which I wanted to avoid. If you have suggestions, I'll gladly move it.
There was a problem hiding this comment.
There is actually a similar light-weight linq implementation at src\Common\src\System\Linq\LowLevelEnumerable.cs that it would be nice to unify this with. Partial class split into a few .cs files, e.g. AsList method should be separate to avoid introducing bad dependencies.
The naming convention for LowLevel* has been to use the same namespace as the full blown counterpart, but I guess that it does not work well here because of you get a reference to System.Linq.dll via standard library. We would need to find a way to remove the reference to System.Linq.dll to avoid ambiguity - likely go back to explicit list of references.
Or if unique namespace is better - I would call it System.LowLevelLinq to make it follow the naming convention.
|
@jkotas I ended up moving it to Internal.LowLevelLinq because it looks better than System.LowLevelLinq - the System prefix really only works for namespaces that have a counterpart in the public surface area. It's in a separate commit, so I can undo it if needed, but I think it makes more sense. Keeping it in the System.Linq namespace would always have the danger of picking up the wrong implementation if references change. It's better to be explicit about it. |
|
👍 |
LINQ Select operator uses generic virtual methods, which is both an overkill, and prevents us from selfhosting the compiler. Replacing all of LINQ with a lighter weight implementation for good measure.
LINQ Select operator uses generic virtual methods, which is both an
overkill, and prevents us from selfhosting the compiler.
Replacing all of LINQ with a lighter weight implementation for good
measure.