Skip to content

Commit

Permalink
Use list comprehension to get potential symbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Sep 12, 2024
1 parent 92b076a commit 7159ca2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sasdata/quantities/unit_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def parse_single_unit(unit_str: str) -> tuple[Unit | None, str]:
string_pos = 0
for char in unit_str:
potential_unit_str = current_unit + char
potential_symbol = symbol_lookup.get(potential_unit_str, None)
if potential_symbol is None:
potential_symbols = [symbol for symbol in symbol_lookup.keys() if symbol.startswith(potential_unit_str)]
if len(potential_symbols) == 0:
break
string_pos += 1
current_unit= potential_unit_str
Expand Down

0 comments on commit 7159ca2

Please sign in to comment.