MCPcopy Index your code
hub / github.com/google/git-appraise / updateThreadsStatus

Function updateThreadsStatus

review/review.go:133–146  ·  view source on GitHub ↗

updateThreadsStatus calculates the aggregate status of a sequence of comment threads. The aggregate status is the conjunction of all of the non-nil child statuses. This has the side-effect of setting the "Resolved" field of all descendant comment threads.

(threads []CommentThread)

Source from the content-addressed store, hash-verified

131//
132// This has the side-effect of setting the "Resolved" field of all descendant comment threads.
133func updateThreadsStatus(threads []CommentThread) *bool {
134 sort.Stable(byTimestamp(threads))
135 noUnresolved := true
136 var result *bool
137 for i := range threads {
138 thread := &threads[i]
139 thread.updateResolvedStatus()
140 if thread.Resolved != nil {
141 noUnresolved = noUnresolved && *thread.Resolved
142 result = &noUnresolved
143 }
144 }
145 return result
146}
147
148// updateResolvedStatus calculates the aggregate status of a single comment thread,
149// and updates the "Resolved" field of that thread accordingly.

Calls 2

byTimestampTypeAlias · 0.85
updateResolvedStatusMethod · 0.80