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

Fix compiler warning about no await operators #1059

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

rmunn
Copy link
Contributor

@rmunn rmunn commented Sep 23, 2024

Fix #1042.

This PR fixes the compiler warning "This async method lacks 'await' operators and will run synchronously" by changing the foreach (var foo in SomeEnumerable) yield return new Foo { ... } code to use LINQ instead, i.e. SomeEnumerable.ToAsyncEnumerable().Select(foo => new Foo { ... }.

Fix the compiler warning "This async method lacks 'await' operators and
will run synchronously."
@rmunn rmunn requested a review from hahn-kev September 23, 2024 04:28
@rmunn rmunn self-assigned this Sep 23, 2024
@rmunn
Copy link
Contributor Author

rmunn commented Sep 23, 2024

There's one question I could not make up my mind about: after running .OrderBy on the sync enumerable, is it better to do .ToAsyncEnumerable().Select(item => new Foo { ... })? Or should the .Select be done on the sync enumrable, and then the final result converted to an async enumerable, i.e. .Select(item => new Foo { ... }).ToAsyncEnumerable()? Or (as I think is correct) does it not actually matter at all?

@hahn-kev
Copy link
Collaborator

I don't think it matters

@rmunn rmunn merged commit d478374 into develop Sep 24, 2024
9 checks passed
@rmunn rmunn deleted the chore/silence-unneeded-compiler-warnings branch September 24, 2024 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Silence some compiler warnings in FwLite
2 participants