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 9d49bf9 commit ac3ee68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tzinfo/ruby_data_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def initialize
# Raises InvalidTimezoneIdentifier if the timezone is not found or the
# identifier is invalid.
def load_timezone_info(identifier)
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__')

Expand Down

0 comments on commit ac3ee68

Please sign in to comment.