Remove a duplicate lookup in the hotpath of MGraph

The set membership test and find can be combined in one lookup call.