]> Cypherpunks repositories - gostls13.git/commit
os: only call GetConsoleMode for char devices
authorqmuntal <quimmuntal@gmail.com>
Mon, 3 Mar 2025 11:28:01 +0000 (12:28 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 3 Mar 2025 19:33:48 +0000 (11:33 -0800)
commit14647b0ac881f084f0063ddb32341fba71e1d2e4
tree774b760132f6dd6a29b1498a1d4521a2f1323857
parent05354fc3b431a5ff8281a145552b3f62178d560c
os: only call GetConsoleMode for char devices

There is no need to call GetConsoleMode if we know that the file
type is not FILE_TYPE_CHAR. This is a tiny performance optimization,
as I sometimes see this call in profiles.

Change-Id: I9e9237908585d0ec8360930a0406b26f52699b92
Reviewed-on: https://go-review.googlesource.com/c/go/+/654155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/os/file_windows.go