Created
April 22, 2019 12:04
-
-
Save jimhester/ea024c95a7453637d4a4d83f82afb808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c2808f4d0f20682d9185d0e68bd33fe98d2dc7c2 Mon Sep 17 00:00:00 2001 | |
From: Jim Hester <james.f.hester@gmail.com> | |
Date: Mon, 22 Apr 2019 07:43:48 -0400 | |
Subject: [PATCH] Avoid using eval-parse | |
--- | |
R/factory.R | 4 +--- | |
1 file changed, 1 insertion(+), 3 deletions(-) | |
diff --git a/R/factory.R b/R/factory.R | |
index d40c774..3d5add2 100644 | |
--- a/R/factory.R | |
+++ b/R/factory.R | |
@@ -55,9 +55,7 @@ factory <- function( | |
body(fun) <- body_replace( | |
fn_body = body(fun), | |
target = rlang::as_name(dot), | |
- replacement = eval(parse( | |
- text = paste0("quote(!!", dot, ")") | |
- )) | |
+ replacement = as.call(list(as.name("!!"), as.name(dot))) | |
) | |
} | |
} else { | |
-- | |
2.17.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment