Rewrite TimingData::ReleaseLookup

This commit is contained in:
sukibaby
2024-07-10 14:57:10 -07:00
committed by teejusb
parent 8f5b45f2ca
commit 963f401c0a
+2 -12
View File
@@ -124,18 +124,8 @@ void TimingData::PrepareLookup()
void TimingData::ReleaseLookup()
{
// According to The C++ Programming Language 3rd Ed., decreasing the size
// of a vector doesn't actually free the memory it has allocated. So this
// small trick is required to actually free the memory. -Kyz
#define CLEAR_LOOKUP(lookup) \
{ \
lookup.clear(); \
beat_start_lookup_t tmp= lookup; \
lookup.swap(tmp); \
}
CLEAR_LOOKUP(m_beat_start_lookup);
CLEAR_LOOKUP(m_time_start_lookup);
#undef CLEAR_LOOKUP
m_beat_start_lookup = beat_start_lookup_t();
m_time_start_lookup = beat_start_lookup_t();
}
RString SegInfoStr(const std::vector<TimingSegment*>& segs, unsigned int index, const RString& name)