Small optimization to relevant_cycles()