mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-12 08:30:05 +00:00
Eliminate various unnecessary uses of std::make_pair
.
This commit is contained in:
parent
f133000656
commit
eb9e5fb727
@ -246,7 +246,7 @@ class ActivityObserver: public Activity::Observer {
|
|||||||
const float right_x = 1.0f - 2.0f * width;
|
const float right_x = 1.0f - 2.0f * width;
|
||||||
float y = 1.0f - 2.0f * height;
|
float y = 1.0f - 2.0f * height;
|
||||||
for(const auto &drive: drives_) {
|
for(const auto &drive: drives_) {
|
||||||
lights_.emplace(std::make_pair(drive, std::make_unique<Outputs::Display::OpenGL::Rectangle>(right_x, y, width, height)));
|
lights_.emplace(drive, std::make_unique<Outputs::Display::OpenGL::Rectangle>(right_x, y, width, height));
|
||||||
y -= height * 2.0f;
|
y -= height * 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ class ActivityObserver: public Activity::Observer {
|
|||||||
const float left_x = -1.0f + 2.0f * width;
|
const float left_x = -1.0f + 2.0f * width;
|
||||||
y = 1.0f - 2.0f * height;
|
y = 1.0f - 2.0f * height;
|
||||||
for(const auto &led: leds_) {
|
for(const auto &led: leds_) {
|
||||||
lights_.emplace(std::make_pair(led, std::make_unique<OpenGL::Rectangle>(left_x, y, width, height)));
|
lights_.emplace(led, std::make_unique<OpenGL::Rectangle>(left_x, y, width, height));
|
||||||
y -= height * 2.0f;
|
y -= height * 2.0f;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -153,7 +153,7 @@ struct CPU::WDC65816::ProcessorStorageConstructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert into the map and return the resulting iterator.
|
// Insert into the map and return the resulting iterator.
|
||||||
return installed_patterns.insert(std::make_pair(key, std::make_pair(micro_op_location_8, micro_op_location_16))).first;
|
return installed_patterns.insert({key, {micro_op_location_8, micro_op_location_16}}).first;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -72,8 +72,8 @@ class Enum {
|
|||||||
result.emplace_back(std::string(start, size_t(d_ptr - start)));
|
result.emplace_back(std::string(start, size_t(d_ptr - start)));
|
||||||
}
|
}
|
||||||
|
|
||||||
members_by_type_.emplace(std::make_pair(std::type_index(typeid(Type)), result));
|
members_by_type_.emplace(std::type_index(typeid(Type)), result);
|
||||||
names_by_type_.emplace(std::make_pair(std::type_index(typeid(Type)), std::string(name)));
|
names_by_type_.emplace(std::type_index(typeid(Type)), std::string(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -294,7 +294,7 @@ template <typename Owner> class StructImpl: public Struct {
|
|||||||
}
|
}
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
permitted_enum_values_.emplace(std::make_pair(name, permitted_values));
|
permitted_enum_values_.emplace(name, permitted_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -25,7 +25,7 @@ template <typename T> void DiskImageHolder<T>::flush_tracks() {
|
|||||||
using TrackMap = std::map<Track::Address, std::shared_ptr<Track>>;
|
using TrackMap = std::map<Track::Address, std::shared_ptr<Track>>;
|
||||||
std::shared_ptr<TrackMap> track_copies(new TrackMap);
|
std::shared_ptr<TrackMap> track_copies(new TrackMap);
|
||||||
for(const auto &address : unwritten_tracks_) {
|
for(const auto &address : unwritten_tracks_) {
|
||||||
track_copies->insert(std::make_pair(address, std::shared_ptr<Track>(cached_tracks_[address]->clone())));
|
track_copies->insert({address, std::shared_ptr<Track>(cached_tracks_[address]->clone())});
|
||||||
}
|
}
|
||||||
unwritten_tracks_.clear();
|
unwritten_tracks_.clear();
|
||||||
|
|
||||||
|
@ -317,14 +317,14 @@ std::map<std::size_t, Sector> Storage::Encodings::AppleGCR::sectors_from_segment
|
|||||||
// Potentially this is a Macintosh sector.
|
// Potentially this is a Macintosh sector.
|
||||||
auto macintosh_sector = decode_macintosh_sector(had_header ? &header : nullptr, sector);
|
auto macintosh_sector = decode_macintosh_sector(had_header ? &header : nullptr, sector);
|
||||||
if(macintosh_sector) {
|
if(macintosh_sector) {
|
||||||
result.insert(std::make_pair(sector_location, std::move(*macintosh_sector)));
|
result.insert({sector_location, std::move(*macintosh_sector)});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apple II then?
|
// Apple II then?
|
||||||
auto appleii_sector = decode_appleii_sector(had_header ? &header : nullptr, sector, is_five_and_three);
|
auto appleii_sector = decode_appleii_sector(had_header ? &header : nullptr, sector, is_five_and_three);
|
||||||
if(appleii_sector) {
|
if(appleii_sector) {
|
||||||
result.insert(std::make_pair(sector_location, std::move(*appleii_sector)));
|
result.insert({sector_location, std::move(*appleii_sector)});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
new_sector->data.push_back(value);
|
new_sector->data.push_back(value);
|
||||||
|
@ -72,7 +72,7 @@ std::map<std::size_t, Storage::Encodings::MFM::Sector> Storage::Encodings::MFM::
|
|||||||
new_sector->samples[0].push_back(shifter.get_byte());
|
new_sector->samples[0].push_back(shifter.get_byte());
|
||||||
++position;
|
++position;
|
||||||
if(position == size + 4) {
|
if(position == size + 4) {
|
||||||
result.insert(std::make_pair(start_location, std::move(*new_sector)));
|
result.insert({start_location, std::move(*new_sector)});
|
||||||
is_reading = false;
|
is_reading = false;
|
||||||
shifter.set_should_obey_syncs(true);
|
shifter.set_should_obey_syncs(true);
|
||||||
new_sector.reset();
|
new_sector.reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user