| 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 |
nothing calls this directly
no test coverage detected