internal/uidriver/glfw: remove an unnecessary error handling

This commit is contained in:
Hajime Hoshi 2022-02-01 01:03:10 +09:00
parent e261951946
commit cbf13630a9

View File

@ -53,11 +53,10 @@ var (
) )
func getSystemMetrics(nIndex int) (int32, error) { func getSystemMetrics(nIndex int) (int32, error) {
r, _, e := procGetSystemMetrics.Call(uintptr(nIndex)) r, _, _ := procGetSystemMetrics.Call(uintptr(nIndex))
if r == 0 { if r == 0 {
if e != nil && e != windows.ERROR_SUCCESS { // GetLastError doesn't provide an extended information.
return 0, fmt.Errorf("glfw: GetSystemMetrics failed: error code: %w", e) // See https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetrics
}
return 0, fmt.Errorf("glfw: GetSystemMetrics returned 0") return 0, fmt.Errorf("glfw: GetSystemMetrics returned 0")
} }
return int32(r), nil return int32(r), nil