Skip to content

Commit

Permalink
src: use starts_with in node_dotenv.cc
Browse files Browse the repository at this point in the history
PR-URL: #53539
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
anonrig authored Jun 25, 2024
1 parent a0cb507 commit 25719b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_dotenv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 25719b1

Please sign in to comment.