Follow-up to #2837 inspired by #1885 / #3460
We decided running duplicated every time we run set/:= to help protect against duplicated assignment is overkill & an efficiency killer.
However, when length(i) > nrow(x), there's no need to run duplicated -- there's guaranteed to be at least one duplicate in i (Pigeonhole):
DT = data.table(a = 1L)
DT[c(1, 1), a := 2:3]
We could warn in this case?
Follow-up to #2837 inspired by #1885 / #3460
We decided running
duplicatedevery time we runset/:=to help protect against duplicated assignment is overkill & an efficiency killer.However, when
length(i) > nrow(x), there's no need to runduplicated-- there's guaranteed to be at least one duplicate ini(Pigeonhole):We could
warnin this case?