read your below code, please declare  `dev_type` as `int`, integer comparison is much faster than string.