parentKey returns a composite key of the parent and child identifiers. The parts of the key are separated by a zero byte.
(parent, child uint64)
| 52 | // parentKey returns a composite key of the parent and child identifiers. The |
| 53 | // parts of the key are separated by a zero byte. |
| 54 | func parentKey(parent, child uint64) []byte { |
| 55 | b := make([]byte, binary.Size([]uint64{parent, child})+1) |
| 56 | i := binary.PutUvarint(b, parent) |
| 57 | j := binary.PutUvarint(b[i+1:], child) |
| 58 | return b[0 : i+j+1] |
| 59 | } |
| 60 | |
| 61 | // parentPrefixKey returns the parent part of the composite key with the |
| 62 | // zero byte separator. |
no test coverage detected
searching dependent graphs…