Skip to content

Commit 38ecaf9

Browse files
authored
Move TEventPBBase::ToString() implementation out of *.h file (#12653)
1 parent 0ac7bee commit 38ecaf9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ydb/library/actors/core/event_pb.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#include "event_pb.h"
22

33
namespace NActors {
4+
TString EventPBBaseToString(const TString& header, const TString& dbgStr) {
5+
TString res;
6+
res.reserve(header.size() + 1 + dbgStr.size());
7+
res.append(header);
8+
res.append(' ');
9+
res.append(dbgStr);
10+
return res;
11+
}
12+
413
bool TRopeStream::Next(const void** data, int* size) {
514
*data = Iter.ContiguousData();
615
*size = Iter.ContiguousSize();

ydb/library/actors/core/event_pb.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace NActorsProto {
1919
} // NActorsProto
2020

2121
namespace NActors {
22+
TString EventPBBaseToString(const TString& header, const TString& dbgStr);
2223

2324
class TRopeStream : public NProtoBuf::io::ZeroCopyInputStream {
2425
TRope::TConstIterator Iter;
@@ -183,9 +184,7 @@ namespace NActors {
183184
}
184185

185186
TString ToString() const override {
186-
TStringStream ss;
187-
ss << ToStringHeader() << " " << Record.ShortDebugString();
188-
return ss.Str();
187+
return EventPBBaseToString(ToStringHeader(), Record.ShortDebugString());
189188
}
190189

191190
bool IsSerializable() const override {

0 commit comments

Comments
 (0)