diff options
author | Juhani Krekelä | 2024-09-19 22:25:47 +0300 |
---|---|---|
committer | Juhani Krekelä | 2024-09-19 22:25:47 +0300 |
commit | c54fd1f2c1d8f477608347e20a3dd7314ec903a6 (patch) | |
tree | 8ab6ee95c43b5c8ea6f9a6906293ca1f0e466082 | |
parent | 9c25e6c52041b83f040d83d04775fc55a1429c78 (diff) | |
download | later-c54fd1f2c1d8f477608347e20a3dd7314ec903a6.tar.gz |
Simplify the .get() method on TitleMap.
Diffstat (limited to '')
-rwxr-xr-x | later | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -77,10 +77,8 @@ class TitleMap: sys.exit(f"later: cannot read title cache: {err}") def get(self, key): - title = self.map.get(key) - - if title or title == "": - return title + if key in self.map: + return self.map[key] if not re.fullmatch(r"https?://.*", key): return None |