optimized code

Signed-off-by: TomWu <phperwuhan@gmail.com>