code optimization

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