algorithms-aunderwo 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/algorithms-aunderwo.gemspec +1 -1
- data/ext/algorithms/string/string.c +4 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/algorithms-aunderwo.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{algorithms-aunderwo}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kanwei Li", "Anthony Underwood"]
|
@@ -11,10 +11,10 @@ int min(int a, int b, int c) {
|
|
11
11
|
|
12
12
|
int levenshtein_distance(VALUE str1, VALUE str2) {
|
13
13
|
int i, j, s1_len, s2_len, *d;
|
14
|
-
char * s =
|
15
|
-
char * t =
|
16
|
-
s1_len =
|
17
|
-
s2_len =
|
14
|
+
char * s = RSTRING_PTR(str1);
|
15
|
+
char * t = RSTRING_PTR(str2);
|
16
|
+
s1_len = RSTRING_LEN(str1);
|
17
|
+
s2_len = RSTRING_LEN(str2);
|
18
18
|
|
19
19
|
if (s1_len == 0) {
|
20
20
|
return s2_len;
|