Simplify code

foreach on empty list does nothing, so we can skip the initial
condition.

Signed-off-by: Michal Čihař <michal@cihar.com>
Remove explicit unsetting of local variables

This was useful in global scope, but makes no sense when used inside
method as all it's variables are cleaned up anyway.

Signed-off-by: Michal Čihař <michal@cihar.com>