Open nguyenduy opened 1 month ago
**suggestion (performance):** Inefficient search for environment variable
Using find and indexOf together can be inefficient. Consider using a single loop or a more efficient method to locate the target line.
find
indexOf
let target = -1; for (let i = 0; i < ENV_VARS.length; i++) { if (ENV_VARS[i].match(new RegExp(key))) { target = i; break; } }
_Originally posted by @sourcery-ai[bot] in https://github.com/simnova/ownercommunity/pull/135#discussion_r1629623988_
Using
find
andindexOf
together can be inefficient. Consider using a single loop or a more efficient method to locate the target line._Originally posted by @sourcery-ai[bot] in https://github.com/simnova/ownercommunity/pull/135#discussion_r1629623988_