resolve segfault on has_edge

This seems to have been related to iterator invalidation, but this seems odd
given it's a map. In any case, it's much cleaner to restructure the stanza
this way.