From be56d29b87bc51f60c527062389ccd6a14cd0e89 Mon Sep 17 00:00:00 2001 From: Andrej Karpathy Date: Sun, 4 Jan 2026 01:40:42 +0000 Subject: [PATCH] simplify redundant if/elif in bloat metrics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- nanochat/report.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nanochat/report.py b/nanochat/report.py index c0f8b2b..6773f0b 100644 --- a/nanochat/report.py +++ b/nanochat/report.py @@ -173,10 +173,7 @@ Generated: {timestamp} if wc_output: total_line = wc_output.strip().split('\n')[-1] parts = total_line.split() - if 'total' in parts: - num_lines = int(parts[0]) - num_chars = int(parts[1]) - elif len(parts) >= 2: + if len(parts) >= 2: num_lines = int(parts[0]) num_chars = int(parts[1]) num_tokens = num_chars // 4 # assume approximately 4 chars per token