Documentation ¶
Overview ¶
Package intern is a string interning library. Pass it a string, and it will store it and return it, removing duplicates. That is, however many times you show it a string, it will only store that string once, and will always return a version of it backed by the same memory.
Storage is kind to GC. It is optimised for storing a very large number of strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intern ¶
type Intern struct { stringbank.Stringbank // contains filtered or unexported fields }
Intern implements the interner. Allocate it
func (*Intern) Deduplicate ¶
Deduplicate takes a string and returns a permanently stored version. This will always be backed by the same memory for the same string.
Click to show internal directories.
Click to hide internal directories.