Skip to content

Commit 7727a80

Browse files
author
maechler
committed
new mtfrm.Date() for speed
git-svn-id: https://svn.r-project.org/R/trunk@88356 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 07e740f commit 7727a80

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

doc/NEWS.Rd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@
157157
instead of hardwired \code{1e-5}; consequently, \code{ts(.., ts.eps=*)}
158158
now passes \code{ts.eps} to the \code{"tsp"} setting C code;
159159
both fixing a long-standing \sQuote{\I{FIXME}}.
160+
161+
\item \code{<Date> \%in\% set} has become as fast again, as it was
162+
before \R 4.3.0, via new S3 method \code{mtfrm.Date}.
160163
}
161164
}
162165
}

src/library/base/R/match.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ char.expand <- function(input, target, nomatch = stop("no match"))
8585
mtfrm <- function(x)
8686
UseMethod("mtfrm")
8787

88-
# also for "Date"
8988
mtfrm.default <- function(x) {
9089
if(length(y <- as.character(x)) != length(x))
9190
stop("cannot mtfrm")
9291
y
9392
}
9493

94+
mtfrm.Date <- # <- for speed
9595
mtfrm.POSIXct <-
9696
mtfrm.POSIXlt <- function(x) as.vector(x, "any")

src/library/base/man/mtfrm.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
% File src/library/base/man/mtfrm.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 2021-2023 R Core Team
3+
% Copyright 2021-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{mtfrm}
77
\title{Auxiliary Function for Matching}
88
\alias{mtfrm}
99
\alias{mtfrm.default}
10+
\alias{mtfrm.Date}
1011
\alias{mtfrm.POSIXct}
1112
\alias{mtfrm.POSIXlt}
1213
\description{

0 commit comments

Comments
 (0)