Commit 83aa040c authored by David Symonds's avatar David Symonds

misc/dashboard/codereview: de-dup LGTMs.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6127066
parent c3c8e35a
...@@ -304,6 +304,7 @@ func updateCL(c appengine.Context, n string) error { ...@@ -304,6 +304,7 @@ func updateCL(c appengine.Context, n string) error {
if i := strings.Index(cl.FirstLine, "\n"); i >= 0 { if i := strings.Index(cl.FirstLine, "\n"); i >= 0 {
cl.FirstLine = cl.FirstLine[:i] cl.FirstLine = cl.FirstLine[:i]
} }
lgtm := make(map[string]bool)
rcpt := make(map[string]bool) rcpt := make(map[string]bool)
for _, msg := range apiResp.Messages { for _, msg := range apiResp.Messages {
s, rev := msg.Sender, false s, rev := msg.Sender, false
...@@ -320,14 +321,16 @@ func updateCL(c appengine.Context, n string) error { ...@@ -320,14 +321,16 @@ func updateCL(c appengine.Context, n string) error {
} }
if msg.Approval { if msg.Approval {
// TODO(dsymonds): De-dupe LGTMs. lgtm[s] = true
cl.LGTMs = append(cl.LGTMs, s)
} }
for _, r := range msg.Recipients { for _, r := range msg.Recipients {
rcpt[r] = true rcpt[r] = true
} }
} }
for l := range lgtm {
cl.LGTMs = append(cl.LGTMs, l)
}
for r := range rcpt { for r := range rcpt {
cl.Recipients = append(cl.Recipients, r) cl.Recipients = append(cl.Recipients, r)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment