remove duplicated codes
Merge pull request #8688 from minggo/remove-duplicated-codes

[ci skip]remove duplicated codes