Use partition instead of split/join

This commit is contained in:
Brandon Rozek 2025-02-18 13:38:39 -05:00
parent 2d8540f5c2
commit 1a4857429f

View file

@ -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: