fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Avoid allocating filename when checking if a document is tombstoned (#400)

The compiler recognises m[string(b)] and can use the value of the byte slice directly when performing a map lookup without needing to allocate the string

author
James Cotter
committer
GitHub
date (Jul 14, 2022, 12:21 PM +0100) commit 44a29877 parent 267622cc
+1 -5
+1 -5
eval.go
··· 231 231 } 232 232 233 233 // Skip documents that are tombstoned 234 - // TODO: This FileTombstones implementation (looking up by filenames) creates a lot of small allocations 235 - // (string filenames) and can have poor cache performance. This should be addressed before we officially 236 - // roll this out. 237 234 if len(repoMetadata.FileTombstones) > 0 { 238 - fileName := string(d.fileName(nextDoc)) 239 - if _, tombstoned := repoMetadata.FileTombstones[fileName]; tombstoned { 235 + if _, tombstoned := repoMetadata.FileTombstones[string(d.fileName(nextDoc))]; tombstoned { 240 236 continue 241 237 } 242 238 }