Permalink
Browse files

Initializing Codepoint object with default values

  • Loading branch information...
1 parent 5923ae6 commit 1afe1aeba528249fc6be8bda4dad6a4dd243646d @hitendrasingh hitendrasingh committed Sep 20, 2013
Showing with 7 additions and 6 deletions.
  1. +0 −6 activesupport/bin/generate_tables
  2. +7 −0 activesupport/lib/active_support/multibyte/unicode.rb
@@ -28,12 +28,6 @@ module ActiveSupport
def initialize
@ucd = Unicode::UnicodeDatabase.new
-
- default = Codepoint.new
- default.combining_class = 0
- default.uppercase_mapping = 0
- default.lowercase_mapping = 0
- @ucd.codepoints = Hash.new(default)
end
def parse_codepoints(line)
@@ -287,6 +287,13 @@ def swapcase(string)
class Codepoint
attr_accessor :code, :combining_class, :decomp_type, :decomp_mapping, :uppercase_mapping, :lowercase_mapping
+ # Initializing Codepoint object with default values
+ def initialize
+ @combining_class = 0
+ @uppercase_mapping = 0
+ @lowercase_mapping = 0
+ end
+
def swapcase_mapping
uppercase_mapping > 0 ? uppercase_mapping : lowercase_mapping
end

0 comments on commit 1afe1ae

Please sign in to comment.