remove duplicated code
Merge pull request #775 from zhouguangming/master

Remove duplicated code