MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Encode32

Method Encode32

tensorflow/core/lib/io/proto_encode_helper.h:70–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 };
69 static uint32 combine(uint32 tag, uint32 type) { return ((tag << 3) | type); }
70 inline void Encode32(uint32 v) {
71 if (v < 128) {
72 // Fast path for single-byte values. Many of the calls will use a
73 // constant value for v, so the comparison will get optimized away
74 // when Encode32 is inlined into the caller.
75 *p_ = v;
76 p_++;
77 } else {
78 p_ = core::EncodeVarint32(p_, v);
79 }
80 }
81 void Encode64(uint64 v) { p_ = core::EncodeVarint64(p_, v); }
82 void EncodeBool(bool v) {
83 *p_ = (v ? 1 : 0); // Equal to varint32 encoding of 0 or 1

Callers

nothing calls this directly

Calls 1

EncodeVarint32Function · 0.85

Tested by

no test coverage detected