aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/searchdoc.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/postgres/searchdoc.go')
-rw-r--r--internal/postgres/searchdoc.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/postgres/searchdoc.go b/internal/postgres/searchdoc.go
index b78fffa0..60830e3f 100644
--- a/internal/postgres/searchdoc.go
+++ b/internal/postgres/searchdoc.go
@@ -53,10 +53,7 @@ func searchDocumentSections(synopsis, readmeFilename, readme string, maxSecWords
rwd := append(rwfd, rwr...)
// Keep maxSecWords of section D, but not more than maxReadmeFrac.
f := int(maxReadmeFrac * float64(len(rwd)))
- nkeep := maxSecWords
- if nkeep > f {
- nkeep = f
- }
+ nkeep := min(maxSecWords, f)
sectionD, _ := split(rwd, nkeep)
// If there is no synopsis, use first sentence of the README.