Avoid using continue in foreach.

Signed-off-by: crynobone <crynobone@gmail.com>