Revert "agent: simplify some loops"
Revert "agent: simplify some loops"

This reverts commit b5dbad910c63b29dadf10731808d6891067a2bfa.

kingland/consul,youhong316/consul,hashicorp/consul,youhong316/consul,kingland/consul,vamage/consul,vamage/consul,scalp42/consul,scalp42/consul,42wim/consul,calgaryscientific/consul,kingland/consul,i0rek/consul,kingland/consul,calgaryscientific/consul,42wim/consul,youhong316/consul,calgaryscientific/consul,i0rek/consul,42wim/consul,hashicorp/consul,vamage/consul,i0rek/consul,hashicorp/consul,calgaryscientific/consul,scalp42/consul,youhong316/consul,hashicorp/consul,calgaryscientific/consul,youhong316/consul,i0rek/consul,scalp42/consul,kingland/consul,scalp42/consul,vamage/consul,vamage/consul,i0rek/consul,42wim/consul,42wim/consul