mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-01 16:58:35 +00:00
Common: Use fmt where applicable
Begins the transition to using fmt for string formatting where applicable. Given fmt supports formatting std::string instances out of the box, we can remove now-unnecessary calls to .c_str() and .data(). Note that this change does not touch the actual logging subsystem aside from converting the final StringFromFormat call in the process over to fmt::format. Given our logging system is heavily used throughout the entire codebase, and converting that over will be quite a large change by itself, this will be tackled near the end of the conversion process.
This commit is contained in:
parent
925afcae3b
commit
5b92d5076a
13 changed files with 287 additions and 263 deletions
|
@ -10,10 +10,11 @@
|
|||
#include <sys/auxv.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
const char procfile[] = "/proc/cpuinfo";
|
||||
|
||||
|
@ -77,9 +78,9 @@ std::string CPUInfo::Summarize()
|
|||
{
|
||||
std::string sum;
|
||||
if (num_cores == 1)
|
||||
sum = StringFromFormat("%s, %i core", cpu_string, num_cores);
|
||||
sum = fmt::format("{}, 1 core", cpu_string);
|
||||
else
|
||||
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
|
||||
sum = fmt::format("{}, {} cores", cpu_string, num_cores);
|
||||
|
||||
if (bAES)
|
||||
sum += ", AES";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue