cfg: delete unused flag values.
don't use 'assert' when it all fits in one line.
cfg: use range-based for's in more instances.

the arrays are (duh) the same len() as the variable we were using
debug: use a switch instead of if chain.

yet another error caught be egrind.