From e43a4e07ec12759127e6b0c34188eb0b6d04ea3f Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 25 Jun 2024 05:41:33 -0400 Subject: [PATCH] src: use `starts_with` in node_dotenv.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/53539 Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/node_dotenv.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_dotenv.cc b/src/node_dotenv.cc index af7433d2a08369..cd761aab70cd52 100644 --- a/src/node_dotenv.cc +++ b/src/node_dotenv.cc @@ -135,8 +135,7 @@ void Dotenv::ParseContent(const std::string_view input) { } // Remove export prefix from key - auto have_export = key.compare(0, 7, "export ") == 0; - if (have_export) { + if (key.starts_with("export ")) { key.remove_prefix(7); }