Skip to content

Commit d278130

Browse files
committed
Extract EmailParsingState from function
~15% perf improvement.
1 parent 41fe441 commit d278130

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

uid2_client/input_util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ def is_phone_number_normalized(phone_number):
2222
return min_phone_number_digits <= total_digits <= max_phone_number_digits
2323

2424

25+
class EmailParsingState:
26+
Starting = 1
27+
Pre = 2
28+
SubDomain = 3
29+
30+
2531
def normalize_email_string(email):
2632
pre_sb = []
2733
pre_sb_specialized = []
2834
sb = []
2935
ws_buffer = []
3036

31-
class EmailParsingState:
32-
Starting = 1
33-
Pre = 2
34-
SubDomain = 3
35-
3637
parsing_state = EmailParsingState.Starting
3738

3839
in_extension = False

0 commit comments

Comments
 (0)