Skip to content

Commit

Permalink
use 'ls()' instead of 'names()' (closes #422)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Nov 3, 2015
1 parent 36c9e20 commit 5c054aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tag-registry.R
Expand Up @@ -3,7 +3,7 @@ tags <- new.env(parent = emptyenv())
parse_tag <- function(x) {
stopifnot(is.roxygen_tag(x))

if (!(x$tag %in% names(tags))) {
if (!(x$tag %in% ls(tags))) {
return(tag_warning(x, "unknown tag"))
}

Expand Down

2 comments on commit 5c054aa

@phaverty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'names' on an environment is a .Primitive and is much faster than 'ls'. 'ls' also sorts by default whereas 'names' does not sort. It probably doesn't matter here though ...

@hadley
Copy link
Member

@hadley hadley commented on 5c054aa Nov 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it doesn't work in 3.1.1 hence the change

Please sign in to comment.