Skip to content

new_rtoi() with records produces "stack usage close to limit" #11

@thechibo

Description

@thechibo

Hello,

The function new_rtoi() calls itself when the records argument is supplied, producing a stack usage error. I post below an indicative solution (my comments start with ###).

#' @rdname new_rtoi
#' @aliases character,sf,character,character,records
setMethod(
  "new_rtoi",
  signature(
    name = "character",
    region = "sf",
    rtoi_path = "character",
    db_path = "character",
    records = "records",
    size = "missing"
  ),
  function(name, region, rtoi_path, db_path, records) {
    newobj <- new_rtoi(name, region, rtoi_path, db_path, records = records) ### remove records = records
    newobj$records <- records ### add this line
    newobj$size <- 0
    write_rtoi(newobj)
    return(newobj)
  }
)

Best Regards,
John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions