Skip to content

Commit

Permalink
fix: inconsistant id generation in different platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Dec 10, 2024
1 parent 027f2ce commit c1f5c3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ make_c_call <- function(choices) {
sanitize_id <- function(id) {
pattern_escape <- "[^0-9A-Za-z_]"

id_new <- gsub(pattern_escape, "_", id)
id_new <- gsub(pattern_escape, "_", id, perl = TRUE)
hashes <- vapply(id[id != id_new], rlang::hash, character(1), USE.NAMES = FALSE)

id[id != id_new] <- paste0("h", substr(hashes, 1, 4), "_", id_new[id != id_new])
Expand Down

0 comments on commit c1f5c3c

Please sign in to comment.