From 205e6d3b975a7f699aeb0341c78a55562094c32b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 30 Dec 2018 20:59:52 -0500 Subject: kernel/svc: Simplify thread core ID sanitizing in CreateThread Rather than use a switch here, this can be collapsed into a simple range check, which is a little easier on the eyes. --- src/core/hle/kernel/svc.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 660e6f577..352ab2d14 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1233,13 +1233,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V ASSERT(processor_id != THREADPROCESSORID_IDEAL); } - switch (processor_id) { - case THREADPROCESSORID_0: - case THREADPROCESSORID_1: - case THREADPROCESSORID_2: - case THREADPROCESSORID_3: - break; - default: + if (processor_id < THREADPROCESSORID_0 || processor_id > THREADPROCESSORID_3) { LOG_ERROR(Kernel_SVC, "Invalid thread processor ID: {}", processor_id); return ERR_INVALID_PROCESSOR_ID; } -- cgit v1.2.3