intern

package
v0.0.0-...-4e6772a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strings

type Strings map[string]*string

func (Strings) FromBytes

func (m Strings) FromBytes(b []byte) *string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL