summaryrefslogtreecommitdiff
path: root/cli/npm/byonm.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-01 09:10:04 -0400
committerGitHub <noreply@github.com>2024-04-01 09:10:04 -0400
commit240b362c002d17bc2b676673ed1b9406683ff0c2 (patch)
treed0c3cdc099b7cac4f29ae17f7ba03ee01a01c877 /cli/npm/byonm.rs
parent8d158058e5abab14d122712a716979b865620995 (diff)
perf(node): put pkg json into an `Rc` (#23156)
Was doing a bit of debugging on why some stuff is not working in a personal project and ran a quick debug profile and saw it cloning the pkg json a lot. We should put this in an Rc.
Diffstat (limited to 'cli/npm/byonm.rs')
-rw-r--r--cli/npm/byonm.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs
index d17be0e95..1e61ce885 100644
--- a/cli/npm/byonm.rs
+++ b/cli/npm/byonm.rs
@@ -3,6 +3,7 @@
use std::borrow::Cow;
use std::path::Path;
use std::path::PathBuf;
+use std::rc::Rc;
use std::sync::Arc;
use deno_ast::ModuleSpecifier;
@@ -52,7 +53,7 @@ impl ByonmCliNpmResolver {
&self,
dep_name: &str,
referrer: &ModuleSpecifier,
- ) -> Option<PackageJson> {
+ ) -> Option<Rc<PackageJson>> {
let referrer_path = referrer.to_file_path().ok()?;
let mut current_folder = referrer_path.parent()?;
loop {