Repository navigation
export uniq function (uniqlist) - #4372
jangorecki wants to merge 15 commits into
Conversation
better codecov more local variable declaration more meaningful variable names better int64 class inheritance check
rework edge cases, that were not being used, to be more consistent
| // we've found 2 different values (first and second). Which one didn't we find? Then just look for that. | ||
| // NA_LOGICAL == INT_MIN checked in init.c | ||
| const int third = (first+second == 1) ? NA_LOGICAL : ( first+second == INT_MIN ? TRUE : FALSE ); | ||
| int third; |
There was a problem hiding this comment.
this is not a const anymore, but to address compiler warnings I would need to int tmp; if (...) tmp = ... else tmp = ...; const int third = tmp; so I think it is OK
Codecov Report
@@ Coverage Diff @@
## master #4372 +/- ##
=======================================
Coverage 99.61% 99.61%
=======================================
Files 72 72
Lines 13916 13984 +68
=======================================
+ Hits 13862 13930 +68
Misses 54 54
Continue to review full report at Codecov.
|
|
@jangorecki WDYT, worth reviving this? I still don't have a great idea for a name of the exported function. IINM the current implementation still assumes it receives a sorted input -- for the exported function, I think the expectation should be that we ensure sorting. |
|
Ensure sorted will suffocate its performance. I found another SO that praises its speed |
| if (!is.integer(order)) { | ||
| if (is.numeric(order)) | ||
| order = as.integer(order) | ||
| else | ||
| stop("'order' must be an integer") | ||
| } |
There was a problem hiding this comment.
| if (!is.integer(order)) { | |
| if (is.numeric(order)) | |
| order = as.integer(order) | |
| else | |
| stop("'order' must be an integer") | |
| } | |
| if (!is.numeric(order)) | |
| stopf("'%s' must be an integer", "order") | |
| order = as.integer(order) |
Not necessarily right? We can have the signature be |
closes #900, also refactor some code for codecov or performance, in uniqlist.c