From 533f5e23d18b0892f2d8e7cc21ee33dded5f83df Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 5 Jan 2025 15:00:38 +0000 Subject: [PATCH] Update tokenizer.py --- tokenizer.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tokenizer.py b/tokenizer.py index dac1199..82d0f99 100644 --- a/tokenizer.py +++ b/tokenizer.py @@ -1,4 +1,3 @@ - # I saved this script as gist because I wrote it a lot of times. # It has support for remembering line numbers and so on what is not used. # It was originally written in C by me and ported to Python. @@ -59,10 +58,7 @@ def process_file(file_path): alinia = 1 words = {} with open(file_path, 'r') as f: - while True: - c = f.read(1) - if not c: - break + while c := f.read(1): pos += 1 valid = True