Skip to content

Commit

Permalink
invert dict, remove now unused inverting function
Browse files Browse the repository at this point in the history
  • Loading branch information
jimman2003 committed Apr 2, 2022
1 parent f56ab2c commit 92998fc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions openlibrary/data/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,8 @@ def f(a):
return lambda s: s and rx.sub(f, s)


def _invert_dict(d):
return {v: k for (k, v) in d.items()}


_pgencode_dict = {"\n": r"\n", "\r": r"\r", "\t": r"\t", "\\": r"\\"}
_pgdecode = _make_sub(_invert_dict(_pgencode_dict))
_pgdecode_dict = {r"\n": "\n", r"\r": "\r", r"\t": "\t", r"\\": "\\"}
_pgdecode = _make_sub(_pgdecode_dict)


def pgdecode(text):
Expand Down

0 comments on commit 92998fc

Please sign in to comment.