CP-36392: Refactor for loop into if statement
CP-36392: Refactor for loop into if statement

For loop acts as if statement. Changed to address static analysis flag.

Signed-off-by: Danilo Del Busso <766dc0f994b57f2d2e98930ecfa5ee8fb1091a62@citrix.com>

kc284/xenadmin,xenserver/xenadmin,kc284/xenadmin,kc284/xenadmin,xenserver/xenadmin,kc284/xenadmin,xenserver/xenadmin,kc284/xenadmin