Skip to content

Commit 58a488d

Browse files
committed
Use RSTRING_PTR and RSTRING_LEN insead of *->len and *->ptr
1 parent fb40819 commit 58a488d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/algorithms/string/string.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ int min(int a, int b, int c) {
1111

1212
int levenshtein_distance(VALUE str1, VALUE str2) {
1313
int i, j, s1_len, s2_len, *d;
14-
char * s = RSTRING(str1)->ptr;
15-
char * t = RSTRING(str2)->ptr;
16-
s1_len = RSTRING(str1)->len;
17-
s2_len = RSTRING(str2)->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);
1818

1919
if (s1_len == 0) {
2020
return s2_len;

0 commit comments

Comments
 (0)