Skip to content

Commit 1a42ef9

Browse files
authored
Merge d51efb1 into 47df49e
2 parents 47df49e + d51efb1 commit 1a42ef9

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/console_reporter.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ void ConsoleReporter::PrintRunData(const Run& result) {
117117
// Format bytes per second
118118
std::string rate;
119119
if (result.bytes_per_second > 0) {
120-
rate = StrCat(" ", HumanReadableNumber(result.bytes_per_second), "B/s");
120+
rate = StringCat(" ", HumanReadableNumber(result.bytes_per_second), "B/s");
121121
}
122122

123123
// Format items per second
124124
std::string items;
125125
if (result.items_per_second > 0) {
126-
items =
127-
StrCat(" ", HumanReadableNumber(result.items_per_second), " items/s");
126+
items = StringCat(" ", HumanReadableNumber(result.items_per_second),
127+
" items/s");
128128
}
129129

130130
const double real_time = result.GetAdjustedRealTime();

src/string_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inline std::ostream& StringCatImp(std::ostream& out, First&& f,
2626
}
2727

2828
template <class... Args>
29-
inline std::string StrCat(Args&&... args) {
29+
inline std::string StringCat(Args&&... args) {
3030
std::ostringstream ss;
3131
StringCatImp(ss, std::forward<Args>(args)...);
3232
return ss.str();

src/sysinfo.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ bool CpuScalingEnabled(int num_cpus) {
191191
// running on Linux, so we silently ignore all the read errors.
192192
std::string res;
193193
for (int cpu = 0; cpu < num_cpus; ++cpu) {
194-
std::string governor_file =
195-
StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor");
194+
std::string governor_file = StringCat("/sys/devices/system/cpu/cpu", cpu,
195+
"/cpufreq/scaling_governor");
196196
if (ReadFromFile(governor_file, &res) && res != "performance") return true;
197197
}
198198
#endif
@@ -225,8 +225,8 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesFromKVFS() {
225225
int Idx = 0;
226226
while (true) {
227227
CPUInfo::CacheInfo info;
228-
std::string FPath = StrCat(dir, "index", Idx++, "/");
229-
std::ifstream f(StrCat(FPath, "size").c_str());
228+
std::string FPath = StringCat(dir, "index", Idx++, "/");
229+
std::ifstream f(StringCat(FPath, "size").c_str());
230230
if (!f.is_open()) break;
231231
std::string suffix;
232232
f >> info.size;
@@ -242,12 +242,12 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesFromKVFS() {
242242
else if (suffix == "K")
243243
info.size *= 1000;
244244
}
245-
if (!ReadFromFile(StrCat(FPath, "type"), &info.type))
245+
if (!ReadFromFile(StringCat(FPath, "type"), &info.type))
246246
PrintErrorAndDie("Failed to read from file ", FPath, "type");
247-
if (!ReadFromFile(StrCat(FPath, "level"), &info.level))
247+
if (!ReadFromFile(StringCat(FPath, "level"), &info.level))
248248
PrintErrorAndDie("Failed to read from file ", FPath, "level");
249249
std::string map_str;
250-
if (!ReadFromFile(StrCat(FPath, "shared_cpu_map"), &map_str))
250+
if (!ReadFromFile(StringCat(FPath, "shared_cpu_map"), &map_str))
251251
PrintErrorAndDie("Failed to read from file ", FPath, "shared_cpu_map");
252252
info.num_sharing = CountSetBitsInCPUMap(map_str);
253253
res.push_back(info);

0 commit comments

Comments
 (0)