(b []byte)
| 37 | } |
| 38 | |
| 39 | func (i *Interner) internBytes(b []byte) []byte { |
| 40 | if x, ok := i.m[bytesToString(b)]; ok { |
| 41 | return x |
| 42 | } |
| 43 | |
| 44 | clone := make([]byte, len(b)) |
| 45 | copy(clone, b) |
| 46 | i.m[bytesToString(clone)] = clone |
| 47 | return clone |
| 48 | } |
| 49 | |
| 50 | func (i *Interner) Close() { |
| 51 | clear(i.m) // clear the map |