MCPcopy
hub / github.com/syncthing/syncthing / add

Method add

script/authors.go:287–307  ·  view source on GitHub ↗
(author author)

Source from the content-addressed store, hash-verified

285}
286
287func (a *authorSet) add(author author) {
288 for _, e := range author.emails {
289 if idx, ok := a.emails[e]; ok {
290 emails := append(author.emails, a.authors[idx].emails...)
291 slices.Sort(emails)
292 emails = slices.Compact(emails)
293 a.authors[idx].name = author.name
294 a.authors[idx].emails = emails
295
296 for _, e := range emails {
297 a.emails[e] = idx
298 }
299 return
300 }
301 }
302
303 for _, e := range author.emails {
304 a.emails[e] = len(a.authors)
305 }
306 a.authors = append(a.authors, author)
307}
308
309func (a *authorSet) setName(email, name string) {
310 idx, ok := a.emails[email]

Callers 1

getAuthorsFunction · 0.95

Calls 1

SortMethod · 0.80

Tested by

no test coverage detected