nm-linux-platform: optimized code

some if statements are redundant, use switch instead of it.

Signed-off-by: luokai01's avatarluokai <454728735@qq.com>
50 jobs for main in 59 minutes and 49 seconds (queued for 3 seconds)