Remove duplicated block of code.
auto merge of #1747 : Ms2ger/servo/duplicated-code, r=jdm