Replace std::make_pair with std::pair CTAD (#7405)

This commit is contained in:
Tyler Veness
2024-11-17 20:29:23 -08:00
committed by GitHub
parent b4bec566f0
commit a04c40f589
18 changed files with 64 additions and 30 deletions

View File

@@ -34,7 +34,7 @@ class Telemetry::Thread : public wpi::SafeThread {
int64_t Telemetry::Thread::GetValue(CS_Handle handle, CS_TelemetryKind kind,
CS_Status* status) {
auto it = m_user.find(std::make_pair(handle, static_cast<int>(kind)));
auto it = m_user.find(std::pair{handle, static_cast<int>(kind)});
if (it == m_user.end()) {
*status = CS_EMPTY_VALUE;
return 0;
@@ -136,8 +136,8 @@ void Telemetry::RecordSourceBytes(const SourceImpl& source, int quantity) {
return;
}
auto handleData = Instance::GetInstance().FindSource(source);
thr->m_current[std::make_pair(Handle{handleData.first, Handle::kSource},
static_cast<int>(CS_SOURCE_BYTES_RECEIVED))] +=
thr->m_current[std::pair{Handle{handleData.first, Handle::kSource},
static_cast<int>(CS_SOURCE_BYTES_RECEIVED)}] +=
quantity;
}
@@ -147,7 +147,7 @@ void Telemetry::RecordSourceFrames(const SourceImpl& source, int quantity) {
return;
}
auto handleData = Instance::GetInstance().FindSource(source);
thr->m_current[std::make_pair(Handle{handleData.first, Handle::kSource},
static_cast<int>(CS_SOURCE_FRAMES_RECEIVED))] +=
thr->m_current[std::pair{Handle{handleData.first, Handle::kSource},
static_cast<int>(CS_SOURCE_FRAMES_RECEIVED)}] +=
quantity;
}

View File

@@ -183,10 +183,10 @@ UnlimitedHandleResource<THandle, TStruct, typeValue, TMutex>::FindIf(F func) {
for (size_t i = 0; i < m_structures.size(); i++) {
auto& structure = m_structures[i];
if (structure != nullptr && func(*structure)) {
return std::make_pair(MakeHandle(i), structure);
return std::pair{MakeHandle(i), structure};
}
}
return std::make_pair(0, nullptr);
return std::pair{0, nullptr};
}
} // namespace cs