blob: 69b0b438b2ff48a10ec6247a779e102b2a8c1cc8 [file] [log] [blame]
package main
var symtab = make(map[string]string)
func intern(s string) string {
if v, ok := symtab[s]; ok {
return v
}
symtab[s] = s
return s
}
func internBytes(s []byte) string {
if v, ok := symtab[string(s)]; ok {
return v
}
v := string(s)
symtab[v] = v
return v
}