package intern
import "github.com/pkg/diff/intern"
Package intern provides string interning.
Unlike much string interning, the routines in this package return *string instead of string. This enables extremely cheap (compare only a pointer) comparisons of any strings interned by this package. Since diff algorithms involve many string comparisons, this often ends up paying for the cost of the interning. Also, in the typical case, diffs involve lots of repeated lines (most of the file contents are typically unchanged, so any give line appears at least twice), so string interning saves memory.
Index ¶
Types ¶
type Strings ¶
func (Strings) FromBytes ¶
Source Files ¶
- Version
- v0.0.0-20241224192749-4e6772a4315c (latest)
- Published
- Dec 24, 2024
- Platform
- linux/amd64
- Last checked
- 1 hour ago –
Tools for package owners.