Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix exponential perf degradation in Time.parse and Time.strptime. #1573

Merged
merged 1 commit into from

3 participants

@int3

Closes #1319.

@atambo atambo merged commit 162571b into from
@int3 int3 deleted the branch
@tduehr tduehr referenced this pull request from a commit in tduehr/jruby
@tduehr tduehr fixup! Merge pull request #1573 from int3/jruby-1_7 5d9e1bc
@enebo enebo added this to the JRuby 1.7.12 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/ruby/1.9/date/format.rb
View
8 lib/ruby/1.9/date/format.rb
@@ -346,8 +346,8 @@ def self._strptime_i(str, fmt, e) # :nodoc:
e._cent ||= if val >= 69 then 19 else 20 end
when 'Z', /\A:{0,3}z/
return unless str.sub!(/\A((?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
- |[[:alpha:].\s]+(?:standard|daylight)\s+time\b
- |[[:alpha:]]+(?:\s+dst)?\b
+ |(?-i:[[:alpha:].\s]+)(?:standard|daylight)\s+time\b
+ |(?-i:[[:alpha:]]+)(?:\s+dst)?\b
)/ix, '')
val = $1
e.zone = val
@@ -505,9 +505,9 @@ def self._parse_time(str, e) # :nodoc:
(
(?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
|
- [[:alpha:].\s]+(?:standard|daylight)\stime\b
+ (?-i:[[:alpha:].\s]+)(?:standard|daylight)\stime\b
|
- [[:alpha:]]+(?:\sdst)?\b
+ (?-i:[[:alpha:]]+)(?:\sdst)?\b
)
)?
/ix,
Something went wrong with that request. Please try again.