Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov"

The PR had some unforseen perf regressions that are not as easy to find.
Revert the PR for now.

This reverts commit 6ae8912a3e, reversing
changes made to 86d6d2b738.
This commit is contained in:
Matthias Krüger 2021-10-15 11:24:20 +02:00
parent 72d66064e7
commit 4457014398
22 changed files with 72 additions and 56 deletions

View file

@ -990,8 +990,9 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
pub fn insert_all_into_row(&mut self, row: R) {
assert!(row.index() < self.num_rows);
let (start, end) = self.range(row);
for word in self.words[start..end].iter_mut() {
*word = !0;
let words = &mut self.words[..];
for index in start..end {
words[index] = !0;
}
self.clear_excess_bits(row);
}
@ -1143,7 +1144,7 @@ impl<R: Idx, C: Idx> SparseBitMatrix<R, C> {
/// Iterates through all the columns set to true in a given row of
/// the matrix.
pub fn iter(&self, row: R) -> impl Iterator<Item = C> + '_ {
pub fn iter<'a>(&'a self, row: R) -> impl Iterator<Item = C> + 'a {
self.row(row).into_iter().flat_map(|r| r.iter())
}