From e9d1cddc97572b7bb255f1b6db993e56c0cbdba2 Mon Sep 17 00:00:00 2001 From: Auguste Lalande Date: Wed, 8 May 2024 20:59:56 -0400 Subject: [PATCH] Simplify arithmetic operation in logical lines checker (#11346) ## Summary Simplify arithmetic operation in logical lines checker --- crates/ruff_linter/src/checkers/logical_lines.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/checkers/logical_lines.rs b/crates/ruff_linter/src/checkers/logical_lines.rs index 4044e6c18a67b..e765e8cf42171 100644 --- a/crates/ruff_linter/src/checkers/logical_lines.rs +++ b/crates/ruff_linter/src/checkers/logical_lines.rs @@ -24,7 +24,7 @@ pub(crate) fn expand_indent(line: &str, indent_width: IndentWidth) -> usize { let tab_size = indent_width.as_usize(); for c in line.bytes() { match c { - b'\t' => indent = (indent / tab_size) * tab_size + tab_size, + b'\t' => indent += tab_size, b' ' => indent += 1, _ => break, }