1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-19 15:11:23 +01:00

One less indirection accessing Region

This commit is contained in:
Paul Licameli
2016-02-01 16:01:14 -05:00
parent fbc75907dd
commit 507cee7ee5
5 changed files with 77 additions and 101 deletions

View File

@@ -1481,10 +1481,9 @@ bool WaveTrack::Disjoin(double t0, double t1)
seqEnd = curSamplePos;
if( seqEnd - seqStart + 1 > minSamples )
{
Region *region = new Region;
region->start = seqStart / GetRate() + clip->GetStartTime();
region->end = seqEnd / GetRate() + clip->GetStartTime();
regions.Add( region );
regions.push_back(Region(
seqStart / GetRate() + clip->GetStartTime(),
seqEnd / GetRate() + clip->GetStartTime()));
}
seqStart = -1;
}
@@ -1493,10 +1492,10 @@ bool WaveTrack::Disjoin(double t0, double t1)
}
}
for( unsigned int i = 0; i < regions.GetCount(); i++ )
for( unsigned int i = 0; i < regions.size(); i++ )
{
SplitDelete( regions.Item( i )->start, regions.Item( i )->end );
delete regions.Item( i );
const Region &region = regions.at(i);
SplitDelete(region.start, region.end );
}
delete[] buffer;