vercel-labs / slacker

A bot that notifies you on Slack whenever your company/product is mentioned on Hacker News. Powered by Vercel Functions & Upstash.
https://slacker.run
346 stars 42 forks source link

Use `Regexp.exec` instead of `replace` for side-effects #13

Open jridgewell opened 2 years ago

jridgewell commented 2 years ago

This replaces the String.p.replace uses that are only used for side-effects with a faster RegExp.p.exec loop. This avoids the string allocation of the output string, and makes it a little more clear the loop is used for side-effects.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
hacker-news-slack-bot ✅ Ready (Inspect) Visit Preview Aug 4, 2022 at 11:44PM (UTC)
leerob commented 2 years ago

Could we add a description so it's clear what this PR solves? 🙏