Minor Optimisation
Closed this issue · 3 comments
berlin-vac-appointment-checker/demon.js
Lines 134 to 177 in 40fa6b1
What about moving the lookup table to a ES6 Map and just check if stat.id
exists and is in that list, then open that link and set isOk true. Would make the lookup table much easier to maintain :)
Something like:
const lookupTable = new Map([ ['arena', 'https://www.doctolib.de/institut/berlin/ciz-berlin-berlin?pid=practice-158431'] ])
followed by
if(stat && stat.id && lookupTable.has(stat.id)){ isOk = true; open(lookupTable.get(stat.id)); }
Yes that's true. At the beginning I wanted to filter for certain vaccination centers. That's why there is this isOk flag. It's not necessary anymore, or could be solved with a lookup map, yes
Do you want me to create a PR?
You can check the code here: Arcticon@02ac828
I merged it, thank you!