mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user