Codechange: replace x.size() == 0 with x.empty()
This commit is contained in:
@@ -873,7 +873,7 @@ static const char *LoadDefaultDLSFile(const char *user_dls)
|
||||
}
|
||||
|
||||
/* If we couldn't load the file from the registry, try again at the default install path of the GM DLS file. */
|
||||
if (dls_file.instruments.size() == 0) {
|
||||
if (dls_file.instruments.empty()) {
|
||||
static const wchar_t *DLS_GM_FILE = L"%windir%\\System32\\drivers\\gm.dls";
|
||||
wchar_t path[MAX_PATH];
|
||||
ExpandEnvironmentStrings(DLS_GM_FILE, path, lengthof(path));
|
||||
|
||||
@@ -347,7 +347,7 @@ static bool FixupMidiData(MidiFile &target)
|
||||
std::sort(target.tempos.begin(), target.tempos.end(), TicktimeAscending<MidiFile::TempoChange>);
|
||||
std::sort(target.blocks.begin(), target.blocks.end(), TicktimeAscending<MidiFile::DataBlock>);
|
||||
|
||||
if (target.tempos.size() == 0) {
|
||||
if (target.tempos.empty()) {
|
||||
/* No tempo information, assume 120 bpm (500,000 microseconds per beat */
|
||||
target.tempos.push_back(MidiFile::TempoChange(0, 500000));
|
||||
}
|
||||
@@ -359,9 +359,9 @@ static bool FixupMidiData(MidiFile &target)
|
||||
uint32_t last_ticktime = 0;
|
||||
for (size_t i = 0; i < target.blocks.size(); i++) {
|
||||
MidiFile::DataBlock &block = target.blocks[i];
|
||||
if (block.data.size() == 0) {
|
||||
if (block.data.empty()) {
|
||||
continue;
|
||||
} else if (block.ticktime > last_ticktime || merged_blocks.size() == 0) {
|
||||
} else if (block.ticktime > last_ticktime || merged_blocks.empty()) {
|
||||
merged_blocks.push_back(block);
|
||||
last_ticktime = block.ticktime;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user