avoid ReadFile syscall if we know that there is nothing to read from file (#56387)
authorAdam Sitnik <adam.sitnik@gmail.com>
Tue, 27 Jul 2021 16:13:38 +0000 (18:13 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Jul 2021 16:13:38 +0000 (18:13 +0200)
commitc81ca16dcde608541e952f17d0d3866d6c9ae94a
treebd8b2bb241ea3b4ef779c4044e2b147a239157b2
parent72393ffa83ffa2db6aac2b21295c167aebfe330e
avoid ReadFile syscall if we know that there is nothing to read from file (#56387)

* avoid ReadFile syscall if we know that there is nothing to read from file

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/AsyncWindowsFileStreamStrategy.cs
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/OSFileStreamStrategy.cs