Skip to content

Commit 470b94b

Browse files
Some x$a => x[["a"]] updates
1 parent b1f26a4 commit 470b94b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

R/make_progression_handler.R

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,22 +230,22 @@ make_progression_handler <- function(name, reporter = list(), handler = NULL, en
230230
}
231231

232232
is_owner <- function(p) {
233-
progressor_uuid <- p$progressor_uuid
233+
progressor_uuid <- p[["progressor_uuid"]]
234234
if (is.null(owner)) owner <<- progressor_uuid
235235
(owner == progressor_uuid)
236236
}
237237

238238
is_duplicated <- function(p) {
239-
progressor_uuid <- p$progressor_uuid
240-
session_uuid <- p$session_uuid
241-
progression_index <- p$progression_index
242-
progression_time <- p$progression_time
239+
progressor_uuid <- p[["progressor_uuid"]]
240+
session_uuid <- p[["session_uuid"]]
241+
progression_index <- p[["progression_index"]]
242+
progression_time <- p[["progression_time"]]
243243
progression_id <- sprintf("%s-%d-%s", session_uuid, progression_index, progression_time)
244-
db <- done[[progressor_uuid]]
244+
db <- done[["progressor_uuid"]]
245245
res <- is.element(progression_id, db)
246246
if (!res) {
247247
db <- c(db, progression_id)
248-
done[[progressor_uuid]] <<- db
248+
done[["progressor_uuid"]] <<- db
249249
}
250250
res
251251
}
@@ -255,7 +255,7 @@ make_progression_handler <- function(name, reporter = list(), handler = NULL, en
255255
stop_if_not(inherits(p, "progression"))
256256

257257
if (inherits(p, "control_progression")) {
258-
type <- p$type
258+
type <- p[["type"]]
259259
if (type == "reset") {
260260
max_steps <<- NULL
261261
step <<- NULL
@@ -292,14 +292,14 @@ make_progression_handler <- function(name, reporter = list(), handler = NULL, en
292292

293293
duplicated <- is_duplicated(p)
294294

295-
type <- p$type
295+
type <- p[["type"]]
296296
debug <- getOption("progressr.debug", FALSE)
297297
if (debug) {
298298
mprintf("Progression calling handler %s ...", sQuote(type))
299299
mprintf("- progression:")
300300
mstr(p)
301-
mprintf("- progressor_uuid: %s", p$progressor_uuid)
302-
mprintf("- progression_index: %s", p$progression_index)
301+
mprintf("- progressor_uuid: %s", p[["progressor_uuid"]])
302+
mprintf("- progression_index: %s", p[["progression_index"]])
303303
mprintf("- duplicated: %s", duplicated)
304304
}
305305

@@ -312,10 +312,10 @@ make_progression_handler <- function(name, reporter = list(), handler = NULL, en
312312
}
313313

314314
if (type == "initiate") {
315-
max_steps <<- p$steps
315+
max_steps <<- p[["steps"]]
316316
if (debug) mstr(list(max_steps=max_steps))
317317
stop_if_not(!is.null(max_steps), is.numeric(max_steps), length(max_steps) == 1L, max_steps >= 1)
318-
auto_finish <<- p$auto_finish
318+
auto_finish <<- p[["auto_finish"]]
319319
times <- min(times, max_steps)
320320
if (debug) mstr(list(auto_finish = auto_finish, times = times, interval = interval, intrusiveness = intrusiveness))
321321

@@ -352,8 +352,8 @@ make_progression_handler <- function(name, reporter = list(), handler = NULL, en
352352
prev_milestone <<- max_steps
353353
.validate_internal_state()
354354
} else if (type == "update") {
355-
if (debug) mstr(list(step=step, "p$amount"=p$amount, max_steps=max_steps))
356-
step <<- min(max(step + p$amount, 0L), max_steps)
355+
if (debug) mstr(list(step=step, "p$amount"=p[["amount"]], max_steps=max_steps))
356+
step <<- min(max(step + p[["amount"]], 0L), max_steps)
357357
stop_if_not(step >= 0L)
358358
msg <- conditionMessage(p)
359359
if (length(msg) > 0) message <<- msg

0 commit comments

Comments
 (0)