igrigorik-bloomfilter 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/sbloomfilter.c +21 -36
- metadata +1 -1
data/ext/sbloomfilter.c
CHANGED
@@ -80,42 +80,27 @@ static VALUE bf_s_new(int argc, VALUE *argv, VALUE self) {
|
|
80
80
|
|
81
81
|
obj = Data_Make_Struct(self, struct BloomFilter, NULL, bits_free, bf);
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
arg3 = INT2FIX(0);
|
105
|
-
arg4 = INT2FIX(1);
|
106
|
-
arg5 = 0;
|
107
|
-
} else if (argc == 1) {
|
108
|
-
arg1 = argv[0];
|
109
|
-
arg2 = INT2FIX(4);
|
110
|
-
arg3 = INT2FIX(0);
|
111
|
-
arg4 = INT2FIX(1);
|
112
|
-
arg5 = 0;
|
113
|
-
} else { /* default = Fugou approach :-) */
|
114
|
-
arg1 = INT2FIX(100000000);
|
115
|
-
arg2 = INT2FIX(4);
|
116
|
-
arg3 = INT2FIX(0);
|
117
|
-
arg4 = INT2FIX(1);
|
118
|
-
arg5 = 0;
|
83
|
+
/* default = Fugou approach :-) */
|
84
|
+
arg1 = INT2FIX(100000000);
|
85
|
+
arg2 = INT2FIX(4);
|
86
|
+
arg3 = INT2FIX(0);
|
87
|
+
arg4 = INT2FIX(1);
|
88
|
+
arg5 = INT2FIX(0);
|
89
|
+
|
90
|
+
switch (argc) {
|
91
|
+
case 5:
|
92
|
+
if (argv[4] == Qtrue) {
|
93
|
+
arg5 = INT2FIX(1);
|
94
|
+
}
|
95
|
+
case 4:
|
96
|
+
arg4 = argv[3];
|
97
|
+
case 3:
|
98
|
+
arg3 = argv[2];
|
99
|
+
case 2:
|
100
|
+
arg2 = argv[1];
|
101
|
+
case 1:
|
102
|
+
arg1 = argv[0];
|
103
|
+
break;
|
119
104
|
}
|
120
105
|
|
121
106
|
m = FIX2INT(arg1);
|