Skip to content

Commit

Permalink
more (potential) optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Dec 23, 2024
1 parent 7541182 commit 5294a3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions R/class_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ database_class <- R6::R6Class(
lookup_get(.subset2(self, "lookup"), name)
},
set_row = function(row) {
lookup_set(
.subset2(self, "lookup"),
names = as.character(.subset2(row, "name")),
object = as.list(row)
)
lookup <- .subset2(self, "lookup")
name <- as.character(.subset2(row, "name"))
object <- as.list(row)
lookup[[name]] <- object
},
del_rows = function(names) {
lookup_remove(.subset2(self, "lookup"), names)
Expand Down
3 changes: 2 additions & 1 deletion R/class_frames.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ frames_get_envir <- function(frames) {
}

frames_set_object <- function(frames, name, object) {
lookup_set(.subset2(frames, "targets"), name, object)
lookup <- .subset2(frames, "targets")
lookup[[name]] <- object
}

frames_clear_objects <- function(frames) {
Expand Down

0 comments on commit 5294a3a

Please sign in to comment.