Fixed #4977 (improve platform type tokenize performance)