Skip to content

Commit

Permalink
Remove unnecessary escaping of + within regex character classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
philr committed Jul 19, 2022
1 parent 9eddbb5 commit cccfad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tzinfo/timezone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def self.default_dst
def self.get(identifier)
instance = @@loaded_zones[identifier]
unless instance
raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /\A[A-Za-z0-9\+\-_]+(\/[A-Za-z0-9\+\-_]+)*\z/
raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /\A[A-Za-z0-9+\-_]+(\/[A-Za-z0-9+\-_]+)*\z/
identifier = identifier.gsub(/-/, '__m__').gsub(/\+/, '__p__')
begin
# Use a temporary variable to avoid an rdoc warning
Expand Down

0 comments on commit cccfad8

Please sign in to comment.