aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJuhani Krekelä2024-09-19 22:25:47 +0300
committerJuhani Krekelä2024-09-19 22:25:47 +0300
commitc54fd1f2c1d8f477608347e20a3dd7314ec903a6 (patch)
tree8ab6ee95c43b5c8ea6f9a6906293ca1f0e466082
parent9c25e6c52041b83f040d83d04775fc55a1429c78 (diff)
downloadlater-c54fd1f2c1d8f477608347e20a3dd7314ec903a6.tar.gz
Simplify the .get() method on TitleMap.
Diffstat (limited to '')
-rwxr-xr-xlater6
1 files changed, 2 insertions, 4 deletions
diff --git a/later b/later
index 7d2f9d0..8a5c686 100755
--- a/later
+++ b/later
@@ -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