mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Switches from testing size() != 0 to empty() != true.
Partly as size() is O(n) but empty is O(1), but primarily for style.
This commit is contained in:
parent
f26fe3756c
commit
3544c0f014
@ -53,7 +53,7 @@ void StaticAnalyser::Commodore::AddTargets(const Media &media, std::list<Target>
|
||||
// check disks
|
||||
for(auto &disk : media.disks) {
|
||||
std::list<File> disk_files = GetFiles(disk);
|
||||
if(disk_files.size()) {
|
||||
if(!disk_files.empty()) {
|
||||
is_disk = true;
|
||||
files.splice(files.end(), disk_files);
|
||||
target.media.disks.push_back(disk);
|
||||
@ -65,14 +65,14 @@ void StaticAnalyser::Commodore::AddTargets(const Media &media, std::list<Target>
|
||||
for(auto &tape : media.tapes) {
|
||||
std::list<File> tape_files = GetFiles(tape);
|
||||
tape->reset();
|
||||
if(tape_files.size()) {
|
||||
if(!tape_files.empty()) {
|
||||
files.splice(files.end(), tape_files);
|
||||
target.media.tapes.push_back(tape);
|
||||
if(!device) device = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(files.size()) {
|
||||
if(!files.empty()) {
|
||||
target.vic20.memory_model = Vic20MemoryModel::Unexpanded;
|
||||
std::ostringstream string_stream;
|
||||
string_stream << "LOAD\"" << (is_disk ? "*" : "") << "\"," << device << ",";
|
||||
@ -136,6 +136,6 @@ void StaticAnalyser::Commodore::AddTargets(const Media &media, std::list<Target>
|
||||
}
|
||||
}
|
||||
|
||||
if(target.media.tapes.size() || target.media.cartridges.size() || target.media.disks.size())
|
||||
if(!target.media.tapes.empty() || !target.media.cartridges.empty() || !target.media.disks.empty())
|
||||
destination.push_back(target);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user