applehttp: Merge two for loops