Skip to content

Commit

Permalink
Extract EmailParsingState from function
Browse files Browse the repository at this point in the history
~15% perf improvement.
  • Loading branch information
mcollins-ttd committed Jul 9, 2024
1 parent 41fe441 commit d278130
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions uid2_client/input_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ def is_phone_number_normalized(phone_number):
return min_phone_number_digits <= total_digits <= max_phone_number_digits


class EmailParsingState:
Starting = 1
Pre = 2
SubDomain = 3


def normalize_email_string(email):
pre_sb = []
pre_sb_specialized = []
sb = []
ws_buffer = []

class EmailParsingState:
Starting = 1
Pre = 2
SubDomain = 3

parsing_state = EmailParsingState.Starting

in_extension = False
Expand Down

0 comments on commit d278130

Please sign in to comment.