From 1a4857429f4d0c137a0019921bbdb3e5e4751b36 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Tue, 18 Feb 2025 13:38:39 -0500 Subject: [PATCH] Use partition instead of split/join --- parse_magic.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/parse_magic.py b/parse_magic.py index 78ca826..7980741 100644 --- a/parse_magic.py +++ b/parse_magic.py @@ -45,10 +45,7 @@ class SourceFile: self.reststr = next(self.fileobj).strip() self.current_line += 1 - tokens = self.reststr.split(" ") - next_token = tokens[0] - self.reststr = " ".join(tokens[1:]) - + next_token, _, self.reststr = self.reststr.partition(" ") return next_token class UglyHeader: