Skip to content

Compare performance of searching for all //SYMBOL_PACKAGE to current vectorized approach in unused_import_linter() #2480

Open
@MichaelChirico

Description

@MichaelChirico

is_ns_used <- vapply(
imported_pkgs,
function(pkg) {
ns_usage <- xml_find_first(xml, paste0("//SYMBOL_PACKAGE[text() = '", pkg, "']"))
!identical(ns_usage, xml2::xml_missing())
},
logical(1L)
)

This runs //SYMBOL_PACKAGE many times; it's almost certainly better to refactor this to run //SYMBOL_PACKAGE once instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalsIssues related to inner workings of lintr, i.e., not user-visible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions