I usually like to avoid the constant branching in an inner loop, But it's not like this function is performance sensitive anyways, and that way's a lot cleaner.

Will change.