MCPcopy Index your code
hub / github.com/Debian/dcs / Get

Method Get

stringpool/stringpool.go:21–39  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

19}
20
21func (pool *StringPool) Get(s string) *string {
22 // Check if the entry is already in the pool with a slightly cheaper
23 // (read-only) mutex.
24 pool.RLock()
25 stored, ok := pool.strings[s]
26 pool.RUnlock()
27 if ok {
28 return stored
29 }
30
31 pool.Lock()
32 defer pool.Unlock()
33 stored, ok = pool.strings[s]
34 if ok {
35 return stored
36 }
37 pool.strings[s] = &s
38 return &s
39}

Callers 15

FilterByKeywordsFunction · 0.80
SearchMethod · 0.80
SearchperpackageMethod · 0.80
parseCacheControlFunction · 0.80
CacheExpiresFunction · 0.80
validateQueryFunction · 0.80
EventsHandlerFunction · 0.80
InstantServerFunction · 0.80
commonMethod · 0.80
renderPerPackageFunction · 0.80
SearchFunction · 0.80
maybeStartQueryFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestRewriteQueryFunction · 0.64