File tree 2 files changed +7
-17
lines changed
2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -842,25 +842,18 @@ lldb::SBError DAP::WaitForProcessToStop(uint32_t seconds) {
842
842
}
843
843
844
844
std::optional<lldb::SBLineEntry> Gotos::GetLineEntry (uint64_t id) const {
845
- const auto iter = line_entries.find (id);
846
- if (iter != line_entries.end ())
847
- return iter->second ;
845
+ if (id > line_entries.size ())
846
+ return std::nullopt;
848
847
849
- return std::nullopt;
848
+ return line_entries[id - 1 ]; // id starts at one.
850
849
}
851
850
852
851
uint64_t Gotos::InsertLineEntry (lldb::SBLineEntry line_entry) {
853
- const auto spec_id = this ->NewSpecID ();
854
- line_entries.insert (std::make_pair (spec_id, line_entry));
855
- return spec_id;
852
+ line_entries.emplace_back (line_entry);
853
+ return line_entries.size ();
856
854
}
857
855
858
- void Gotos::Clear () {
859
- new_id = 0 ;
860
- line_entries.clear ();
861
- }
862
-
863
- uint64_t Gotos::NewSpecID () { return new_id++; }
856
+ void Gotos::Clear () { line_entries.clear (); }
864
857
865
858
void Variables::Clear () {
866
859
locals.Clear ();
Original file line number Diff line number Diff line change @@ -92,10 +92,7 @@ class Gotos {
92
92
void Clear ();
93
93
94
94
private:
95
- uint64_t NewSpecID ();
96
-
97
- llvm::DenseMap<uint64_t , lldb::SBLineEntry> line_entries;
98
- uint64_t new_id = 0 ;
95
+ std::vector<lldb::SBLineEntry> line_entries;
99
96
};
100
97
101
98
struct Variables {
You can’t perform that action at this time.
0 commit comments