visualize_helper 0.0.10.35 → 0.0.10.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/visualize_helper/visualize_helper.c +8 -5
- data/lib/visualize_helper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 456169916820789ddefcb47c47f19f20448caffd
|
4
|
+
data.tar.gz: 964c6af00c4b22c77d5f5e4f5055683e7261ce87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57f7cf913c2f10971eca8fb51eab2960046e9e0cb8a5dd5e021f6b89a1d70b4c57e6d14a47d1136940448d0625957cac878efbf8ab1f958c81e726c8eac067ed
|
7
|
+
data.tar.gz: 672f2ba3cd558ec57c6718b77ae199709dec8f55c9fc67f8de7fb8e7233e13b9142efb2f1fbbd123dfff678d55c6f16b537760e8d503887fc13c875bef9b5e41
|
@@ -34,8 +34,9 @@ static VALUE uniq(VALUE sorted_array){
|
|
34
34
|
//initialize variables for compare
|
35
35
|
char* previous;
|
36
36
|
char* current;
|
37
|
+
int i;
|
37
38
|
|
38
|
-
for(
|
39
|
+
for( i = 0; i < RARRAY_LEN(sorted_array); i++){
|
39
40
|
VALUE current_temp = rb_ary_entry(sorted_array,i);
|
40
41
|
current = StringValuePtr(current_temp);
|
41
42
|
// initial case, when there is no previous
|
@@ -65,11 +66,12 @@ static char* join(VALUE strings){
|
|
65
66
|
int string_total_size = 0;
|
66
67
|
VALUE string_temp;
|
67
68
|
VALUE result;
|
69
|
+
int i;
|
68
70
|
|
69
71
|
|
70
72
|
|
71
73
|
// calculate the exact size of malloc
|
72
|
-
for (
|
74
|
+
for ( i = 0; i < strings_size; i++) {
|
73
75
|
string_temp = rb_ary_entry(strings,i);
|
74
76
|
string_total_size += strlen(StringValuePtr(string_temp));
|
75
77
|
}
|
@@ -81,7 +83,7 @@ static char* join(VALUE strings){
|
|
81
83
|
sprintf(joined,"%s", StringValuePtr(string_temp));
|
82
84
|
|
83
85
|
|
84
|
-
for (
|
86
|
+
for (i = 1 ; i < strings_size; i++) {
|
85
87
|
|
86
88
|
string_temp = rb_ary_entry(strings,i);
|
87
89
|
sprintf(joined,"%s,%s", joined, StringValuePtr(string_temp));
|
@@ -100,8 +102,9 @@ static VALUE sort_uniq(VALUE strings, int unique)
|
|
100
102
|
{
|
101
103
|
int strings_size = RARRAY_LEN(strings);
|
102
104
|
const char *input[strings_size];
|
105
|
+
int i;
|
103
106
|
|
104
|
-
for (
|
107
|
+
for (i = 0; i< strings_size; i++){
|
105
108
|
VALUE string = rb_ary_entry(strings,i);
|
106
109
|
input[i] = StringValuePtr(string);
|
107
110
|
}
|
@@ -112,7 +115,7 @@ static VALUE sort_uniq(VALUE strings, int unique)
|
|
112
115
|
|
113
116
|
// Transform the result input into a ruby array
|
114
117
|
VALUE resultado = rb_ary_new();
|
115
|
-
for (
|
118
|
+
for (i=0; i<stringLen; ++i) {
|
116
119
|
rb_ary_push(resultado,rb_str_new2(input[i]));
|
117
120
|
}
|
118
121
|
|