| 285 | } |
| 286 | |
| 287 | func (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 | |
| 309 | func (a *authorSet) setName(email, name string) { |
| 310 | idx, ok := a.emails[email] |