(b *buffer, tag int, x []int64)
| 113 | } |
| 114 | |
| 115 | func encodeInt64s(b *buffer, tag int, x []int64) { |
| 116 | if len(x) > 2 { |
| 117 | // Use packed encoding |
| 118 | n1 := len(b.data) |
| 119 | for _, u := range x { |
| 120 | encodeVarint(b, uint64(u)) |
| 121 | } |
| 122 | n2 := len(b.data) |
| 123 | encodeLength(b, tag, n2-n1) |
| 124 | n3 := len(b.data) |
| 125 | copy(b.tmp[:], b.data[n2:n3]) |
| 126 | copy(b.data[n1+(n3-n2):], b.data[n1:n2]) |
| 127 | copy(b.data[n1:], b.tmp[:n3-n2]) |
| 128 | return |
| 129 | } |
| 130 | for _, u := range x { |
| 131 | encodeInt64(b, tag, u) |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func encodeInt64Opt(b *buffer, tag int, x int64) { |
| 136 | if x == 0 { |
no test coverage detected
searching dependent graphs…