Skip to content

Commit

Permalink
Move TEventPBBase::ToString() implementation out of *.h file (#12653)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherednik authored Dec 17, 2024
1 parent 0ac7bee commit 38ecaf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ydb/library/actors/core/event_pb.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#include "event_pb.h"

namespace NActors {
TString EventPBBaseToString(const TString& header, const TString& dbgStr) {
TString res;
res.reserve(header.size() + 1 + dbgStr.size());
res.append(header);
res.append(' ');
res.append(dbgStr);
return res;
}

bool TRopeStream::Next(const void** data, int* size) {
*data = Iter.ContiguousData();
*size = Iter.ContiguousSize();
Expand Down
5 changes: 2 additions & 3 deletions ydb/library/actors/core/event_pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace NActorsProto {
} // NActorsProto

namespace NActors {
TString EventPBBaseToString(const TString& header, const TString& dbgStr);

class TRopeStream : public NProtoBuf::io::ZeroCopyInputStream {
TRope::TConstIterator Iter;
Expand Down Expand Up @@ -183,9 +184,7 @@ namespace NActors {
}

TString ToString() const override {
TStringStream ss;
ss << ToStringHeader() << " " << Record.ShortDebugString();
return ss.Str();
return EventPBBaseToString(ToStringHeader(), Record.ShortDebugString());
}

bool IsSerializable() const override {
Expand Down

0 comments on commit 38ecaf9

Please sign in to comment.