Skip to content

Commit c3d78a7

Browse files
committed
[libc][benchmarks] Tidy uses of raw_string_ostream (NFC)
As specified in the docs, 1) raw_string_ostream is always unbuffered and 2) the underlying buffer may be used directly ( 65b1361 for further reference ) Avoid unneeded calls to raw_string_ostream::str(), to avoid excess indirection.
1 parent adeae92 commit c3d78a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libc/benchmarks/MemorySizeDistributions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ getDistributionOrDie(ArrayRef<MemorySizeDistribution> Distributions,
197197
<< "', available distributions:\n";
198198
for (const auto &MSD : Distributions)
199199
Stream << "'" << MSD.Name << "'\n";
200-
report_fatal_error(Stream.str());
200+
report_fatal_error(Message);
201201
}
202202

203203
} // namespace libc_benchmarks

libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TEST(Automemcpy, Codegen) {
5050
raw_string_ostream OutputStream(Output);
5151
Serialize(OutputStream, kDescriptors);
5252

53-
EXPECT_STREQ(OutputStream.str().c_str(),
53+
EXPECT_STREQ(Output.c_str(),
5454
R"(// This file is auto-generated by libc/benchmarks/automemcpy.
5555
// Functions : 6
5656

0 commit comments

Comments
 (0)