Skip to content

Fill the incomplete usage of async methods.#138

Merged
adoconnection merged 2 commits into
adoconnection:masterfrom
A9G-Data-Droid:AsyncReview
Dec 27, 2023
Merged

Fill the incomplete usage of async methods.#138
adoconnection merged 2 commits into
adoconnection:masterfrom
A9G-Data-Droid:AsyncReview

Conversation

@A9G-Data-Droid
Copy link
Copy Markdown
Contributor

I apologize if I don't know the historical reasons why not all the methods are async. I did a quick review and wanted to share my notes. I hope some of these changes useful.

All tests pass without modification.

  • Prefer Task.Run over Task.Factory.StartNew
  • Compile in release mode with overflow checks for safety.
  • Implement await using when available.
  • Remove unused result.GetType();
  • CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync

 - Prefer Task.Run over Task.Factory.StartNew
 - Compile in release mode with overflow checks for safety.
 - Implement `await using` when available.
 - Remove unused `result.GetType();`
- CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync
@adoconnection
Copy link
Copy Markdown
Owner

Thanks! Improvements are always welcome 🚀
You mean ReadLong and WriteLong? Well they manipute few bytes so I thought its insignificant, no other reasons

@adoconnection adoconnection merged commit a6e8e84 into adoconnection:master Dec 27, 2023
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.

2 participants