minor FP-style function refactor
auto merge of #657 : tkuehn/servo/master, r=metajack