X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0514b290f5ff9a2700b599bf6fb19a468a73c3fb..47a5c66948792602f657e5e1157bfd172d23c546:/services/datamanager/summary/canonical_string.go?ds=sidebyside diff --git a/services/datamanager/summary/canonical_string.go b/services/datamanager/summary/canonical_string.go deleted file mode 100644 index 152314cf6f..0000000000 --- a/services/datamanager/summary/canonical_string.go +++ /dev/null @@ -1,30 +0,0 @@ -/* Ensures that we only have one copy of each unique string. This is -/* not designed for concurrent access. */ - -package summary - -// This code should probably be moved somewhere more universal. - -// CanonicalString struct -type CanonicalString struct { - m map[string]string -} - -// Get a CanonicalString -func (cs *CanonicalString) Get(s string) (r string) { - if cs.m == nil { - cs.m = make(map[string]string) - } - value, found := cs.m[s] - if found { - return value - } - - // s may be a substring of a much larger string. - // If we store s, it will prevent that larger string from getting - // garbage collected. - // If this is something you worry about you should change this code - // to make an explict copy of s using a byte array. - cs.m[s] = s - return s -}