Avoid excessive amount of data in large repos
This commit is contained in:
parent
67205ab7cf
commit
fa9cf9d1c5
1 changed files with 11 additions and 0 deletions
|
|
@ -96,6 +96,17 @@ fn count(path: &Path) -> somehow::Result<Counts> {
|
|||
}
|
||||
}
|
||||
|
||||
// Avoid excessive amounts of data in very large repos
|
||||
if counts.files_by_dir.len() > 1000 {
|
||||
counts.files_by_dir.retain(|name, _| !name.contains('/'));
|
||||
}
|
||||
if counts.lines_by_dir.len() > 1000 {
|
||||
counts.lines_by_dir.retain(|name, _| !name.contains('/'));
|
||||
}
|
||||
if counts.todos_by_dir.len() > 1000 {
|
||||
counts.todos_by_dir.retain(|name, _| !name.contains('/'));
|
||||
}
|
||||
|
||||
Ok(counts)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue