This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Replace bespoke iterator check with std::next
ClosedPublic

Authored by bulbazord on Aug 29 2023, 5:20 PM.

Details

Summary

The primary goal of this change is to change if (pair != *(--m_dict.end()))
to if (std::next(iter) != m_dict.end()). I was experimenting with
changing the underlying type of m_dict and found that this was an
issue. Specifically, it assumes that m_dict iterators are bidirectional.
This change should make it so we only need to assume m_dict iterators can move
forward.

Diff Detail

Event Timeline

bulbazord created this revision.Aug 29 2023, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 5:20 PM
bulbazord requested review of this revision.Aug 29 2023, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 5:20 PM
JDevlieghere accepted this revision.Aug 30 2023, 9:46 PM

LGTM 🚢

This revision is now accepted and ready to land.Aug 30 2023, 9:46 PM
fdeazeve accepted this revision.Aug 31 2023, 6:39 AM

Nice catch!

This revision was landed with ongoing or failed builds.Aug 31 2023, 10:57 AM
This revision was automatically updated to reflect the committed changes.