use case instead of set of int in osproc (#24277)

As said in the warning after #21659, a set of ints defaults to
`set[range[0..65535]]` which is very large. So in osproc, a `case`
statement is used instead of an int set to check for an int being one of
2 values.

Also tested all of CI with the warning from #21659 as an error, this
seems to be the only remaining case in CI.
This commit is contained in:
metagn
2024-10-11 12:17:04 +03:00
committed by GitHub
parent 9c85f4fd07
commit 706985997e

View File

@@ -740,7 +740,8 @@ when defined(windows) and not defined(useNimRtl):
if poInteractive in result.options: close(result)
const errInvalidParameter = 87.int
const errFileNotFound = 2.int
if lastError.int in {errInvalidParameter, errFileNotFound}:
case lastError.int
of errInvalidParameter, errFileNotFound:
raiseOSError(lastError,
"Requested command not found: '" & command & "'. OS error:")
else: