From c54fd1f2c1d8f477608347e20a3dd7314ec903a6 Mon Sep 17 00:00:00 2001 From: Juhani Krekelä Date: Thu, 19 Sep 2024 22:25:47 +0300 Subject: Simplify the .get() method on TitleMap. --- later | 6 ++---- 1 file 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 -- cgit v1.2.3-2-gb3c3