MCPcopy Create free account
hub / github.com/dropbox/dbxcli / appendSearchMatches

Function appendSearchMatches

cmd/search.go:149–159  ·  view source on GitHub ↗
(entries []files.IsMetadata, matches []*files.SearchMatchV2, limit uint64)

Source from the content-addressed store, hash-verified

147}
148
149func appendSearchMatches(entries []files.IsMetadata, matches []*files.SearchMatchV2, limit uint64) []files.IsMetadata {
150 for _, m := range matches {
151 if searchLimitReached(entries, limit) {
152 break
153 }
154 if m.Metadata != nil && m.Metadata.Metadata != nil {
155 entries = append(entries, m.Metadata.Metadata)
156 }
157 }
158 return entries
159}
160
161func searchLimitReached(entries []files.IsMetadata, limit uint64) bool {
162 return limit > 0 && uint64(len(entries)) >= limit

Callers 1

searchFunction · 0.85

Calls 1

searchLimitReachedFunction · 0.85

Tested by

no test coverage detected