In deviceauth what does the function GetDeviceStatus do?

It seems it takes in the device id and queries mongo but filters by the deviceid, so it should only ever return one result right? then map reduce just makes it so if there are more than one returned take the sum of the status. but then why run a for loop on the return. technically there should only be ever one returned result making mapreduce not needed or am i missing something?