[Rd] Unneeded if statements in RealFromComplex C code

2021-09-09 Thread Hervé Pagès
Hi, I just stumbled across these 2 lines in RealFromComplex (lines 208 & 209 in src/main/coerce.c): double attribute_hidden RealFromComplex(Rcomplex x, int *warn) { if (ISNAN(x.r) || ISNAN(x.i)) return NA_REAL; if (ISNAN(x.r)) return x.r; <- line

Re: [Rd] Should Position() use match.fun()?

2021-09-09 Thread Kurt Hornik
> Kurt Hornik writes: > Steve Martin writes: >> Hello, >> All of the funprog functions except Position() use match.fun() early >> in the body of the function. (Filter() seems to rely on lapply() for >> this, but the effect is the same.) > Right. >> In most cases this isn't a problem, b

Re: [Rd] Should Position() use match.fun()?

2021-09-09 Thread Kurt Hornik
> Steve Martin writes: > Hello, > All of the funprog functions except Position() use match.fun() early > in the body of the function. (Filter() seems to rely on lapply() for > this, but the effect is the same.) Right. > In most cases this isn't a problem, but I can't see why Position() > s