Skip to content

Commit

Permalink
fix: remove srcref after leanification (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer authored Sep 19, 2023
1 parent b7f657d commit 5343fc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# mlr3misc 0.12.0-9000

* fix: Fixed an important bug that caused serialized objects to be overly large
when installing mlr3 with `--with-keep.source` (#88)

# mlr3misc 0.12.0

* Added new encapsulation mode `"try"`.
Expand Down
4 changes: 4 additions & 0 deletions R/leanify.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ leanificate_method = function(cls, fname, env = cls$parent_env) {
environment(replacingfn) = environment(fn)

function_kind = switch(function_kind_container, public_methods = "public", private_methods = "private", active = "active")
# We remove the srcref (which exists when installing with option --with-keep.source) because:
# (1) incorrect rendering of leanified functions
# (2) use up memory unnecessarily
origattributes$srcref = NULL
attributes(replacingfn) = origattributes
cls$set(function_kind, fname, replacingfn, overwrite = TRUE)
}
Expand Down

0 comments on commit 5343fc5

Please sign in to comment.