nitc :: IndexMatches :: limit
limit
Return a new IndexMatches instance with only the limit
first matches.
# Limit the matches with `limit`
#
# Return a new IndexMatches instance with only the `limit` first matches.
fun limit(limit: Int): IndexMatches do
var res = new Array[IndexMatch]
for match in self do
if res.length >= limit then break
res.add match
end
return new IndexMatches.from_matches(res)
end
src/model/model_index.nit:469,2--479,4