Skip to content

Commit 01018d3

Browse files
authored
.data pronoun speedup (#5731)
* For extract usage, consider `.data` pronoun as non-data. * Add news bullet
1 parent bc3e401 commit 01018d3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
# ggplot2 (development version)
33

4+
* Fixed performance loss when the `.data` pronoun is used in `aes()` (#5730).
45
* Fixed bug where discrete scales could not map aesthetics only consisting of
56
`NA`s (#5623)
67
* Facet evaluation is better at dealing with inherited errors

R/aes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ alternative_aes_extract_usage <- function(x) {
430430
}
431431

432432
extract_target_is_likely_data <- function(x, data, env) {
433-
if (!is.name(x[[2]])) {
433+
if (!is.name(x[[2]]) || identical(x[[2]], quote(.data))) {
434434
return(FALSE)
435435
}
436436

0 commit comments

Comments
 (0)