Trigram.xs

filter: Statementstmt 40.0% 72 / 180 Branchbran 16.6% 17 / 102 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 31.5% 89 / 282 SCAR 0
CC
0
Cov
0%
CRAP 0
↑ Summary strigram.c »
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4 #include "strigram.h"
5 #include "strigram_compat.h"
6  
7 #define STRIGRAM_FROM_SV(sv) INT2PTR(strigram_t *, SvIV(SvRV(sv)))
8  
9 /* ======================================================
10 Custom op descriptors
11 ====================================================== */
12  
13 static XOP xop_strigram_add;
14 static XOP xop_strigram_search;
15 static XOP xop_strigram_remove;
16 static XOP xop_strigram_clear;
17 static XOP xop_strigram_optimize;
18 static XOP xop_strigram_doc_count;
19 static XOP xop_strigram_trigram_count;
20  
21 /* ======================================================
22 pp_ implementations
23 ====================================================== */
24  
25 /* BINOP: self (TOPs), text (POPs) -> UV doc_id replaces self */
26 static OP *
27 0 pp_strigram_add(pTHX) {
28 0 dSP;
29 0 SV *text_sv = POPs;
30 0 SV *self = TOPs;
31 STRLEN len;
32 0 const char *str = SvPVutf8(text_sv, len);
33 0 SETs(sv_2mortal(newSVuv(
34 (UV)strigram_add(STRIGRAM_FROM_SV(self), str, (uint32_t)len))));
35 0 RETURN;
36 }
37  
38 /* BINOP: self (TOPs), query (POPs) -> AV ref replaces self.
39 limit from op_targ (0 = use default 10; non-zero = that value). */
40 static OP *
41 0 pp_strigram_search(pTHX) {
42 0 dSP;
43 0 SV *query_sv = POPs;
44 0 SV *self = TOPs;
45 0 ▶ uint32_t limit = PL_op->op_targ ? (uint32_t)PL_op->op_targ : 10;
Branch: 1 branch
BranchTrueFalseTotal
uint32_t limit = PL_op->op_targ ? (uint32_t)PL_op->op_targ : 10; 0 0 0
46 STRLEN qlen;
47 const char *qstr;
48 0 uint32_t rcount = 0;
49 strigram_result_t *results;
50 AV *av;
51 uint32_t i;
52  
53 0 qstr = SvPVutf8(query_sv, qlen);
54 0 results = strigram_search(STRIGRAM_FROM_SV(self), qstr, (uint32_t)qlen,
55 limit, &rcount);
56 0 av = newAV();
57 0 ▶ if (results) {
Branch: 1 branch
BranchTrueFalseTotal
if (results) { 0 0 0
58 0 ▶ for (i = 0; i < rcount; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < rcount; i++) { 0 0 0
59 0 HV *hv = newHV();
60 0 hv_stores(hv, "doc_id", newSVuv(results[i].doc_id));
61 0 hv_stores(hv, "score", newSVnv(results[i].score));
62 0 hv_stores(hv, "text",
63 newSVpvn_flags(results[i].text, results[i].text_len, SVf_UTF8));
64 0 av_push(av, newRV_noinc((SV *)hv));
65 }
66 0 strigram_results_free(results);
67 }
68 0 SETs(sv_2mortal(newRV_noinc((SV *)av)));
69 0 RETURN;
70 }
71  
72 /* BINOP: self (POPs), doc_id (POPs) -> void */
73 static OP *
74 0 pp_strigram_remove(pTHX) {
75 0 dSP;
76 0 SV *id_sv = POPs;
77 0 SV *self = POPs;
78 0 strigram_remove(STRIGRAM_FROM_SV(self), (uint32_t)SvUV(id_sv));
79 0 RETURN;
80 }
81  
82 /* UNOP: self (POPs) -> void */
83 static OP *
84 0 pp_strigram_clear(pTHX) {
85 0 dSP;
86 0 SV *self = POPs;
87 0 strigram_clear(STRIGRAM_FROM_SV(self));
88 0 RETURN;
89 }
90  
91 /* UNOP: self (POPs) -> void */
92 static OP *
93 0 pp_strigram_optimize(pTHX) {
94 0 dSP;
95 0 SV *self = POPs;
96 0 strigram_optimize(STRIGRAM_FROM_SV(self));
97 0 RETURN;
98 }
99  
100 /* UNOP: self (TOPs) -> UV replaces self */
101 static OP *
102 0 pp_strigram_doc_count(pTHX) {
103 0 dSP;
104 0 SV *self = TOPs;
105 0 SETs(sv_2mortal(newSVuv(
106 (UV)strigram_doc_count(STRIGRAM_FROM_SV(self)))));
107 0 RETURN;
108 }
109  
110 /* UNOP: self (TOPs) -> UV replaces self */
111 static OP *
112 0 pp_strigram_trigram_count(pTHX) {
113 0 dSP;
114 0 SV *self = TOPs;
115 0 SETs(sv_2mortal(newSVuv(
116 (UV)strigram_trigram_count(STRIGRAM_FROM_SV(self)))));
117 0 RETURN;
118 }
119  
120 /* ======================================================
121 Call checkers
122 ====================================================== */
123  
124 static int
125 0 strigram_simple_op(OP *op) {
126 0 ▶ if (!op) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (!op) return 0; 0 0 0
127 0 ▶ switch (op->op_type) {
Branch: 1 branch
BranchTrueFalseTotal
switch (op->op_type) { 0 0 0
128 0 case OP_PADSV:
129 case OP_CONST:
130 case OP_GV:
131 case OP_GVSV:
132 case OP_AELEMFAST:
133 #if defined(OP_AELEMFAST_LEX) && OP_AELEMFAST_LEX != OP_AELEMFAST
134 case OP_AELEMFAST_LEX:
135 #endif
136 case OP_NULL:
137 0 return 1;
138 0 default:
139 0 return 0;
140 }
141 }
142  
143 /* Walk entersub op tree into its components. */
144 static void
145 0 strigram_walk_args(OP *entersubop,
146 OP **pushop_out, OP **selfop_out,
147 OP **argop_out, OP **cvop_out)
148 {
149 OP *pushop, *selfop, *argop, *cvop;
150 0 pushop = cUNOPx(entersubop)->op_first;
151 0 ▶ if (!OpHAS_SIBLING(pushop))
Branch: 1 branch
BranchTrueFalseTotal
if (!OpHAS_SIBLING(pushop)) 0 0 0
152 0 pushop = cUNOPx(pushop)->op_first;
153 0 ▶ selfop = OpSIBLING(pushop);
Branch: 1 branch
BranchTrueFalseTotal
selfop = OpSIBLING(pushop); 0 0 0
154 0 cvop = argop = selfop;
155 0 ▶ while (OpHAS_SIBLING(cvop)) {
Branch: 1 branch
BranchTrueFalseTotal
while (OpHAS_SIBLING(cvop)) { 0 0 0
156 0 argop = cvop;
157 0 ▶ cvop = OpSIBLING(cvop);
Branch: 1 branch
BranchTrueFalseTotal
cvop = OpSIBLING(cvop); 0 0 0
158 }
159 0 *pushop_out = pushop;
160 0 *selfop_out = selfop;
161 0 *argop_out = argop;
162 0 *cvop_out = cvop;
163 0 }
164  
165 /* Stamp out per-method call checkers with macros to avoid storing
166 function pointers in ckobj (non-portable cast on some platforms). */
167  
168 #define STRIGRAM_CK_UNOP(ck_name, pp_func) \
169 static OP * \
170 ck_name(pTHX_ OP *entersubop, GV *namegv, SV *ckobj) \
171 { \
172 OP *pushop, *selfop, *argop, *cvop, *newop; \
173 PERL_UNUSED_ARG(namegv); \
174 PERL_UNUSED_ARG(ckobj); \
175 strigram_walk_args(entersubop, &pushop, &selfop, &argop, &cvop); \
176 if (argop != selfop) return entersubop; \
177 if (!strigram_simple_op(selfop)) return entersubop; \
178 OpMORESIB_set(pushop, cvop); \
179 OpLASTSIB_set(selfop, NULL); \
180 newop = newUNOP(OP_NULL, 0, selfop); \
181 newop->op_type = OP_CUSTOM; \
182 newop->op_ppaddr = pp_func; \
183 op_free(entersubop); \
184 return newop; \
185 }
186  
187 #define STRIGRAM_CK_BINOP(ck_name, pp_func) \
188 static OP * \
189 ck_name(pTHX_ OP *entersubop, GV *namegv, SV *ckobj) \
190 { \
191 OP *pushop, *selfop, *argop, *cvop, *newop; \
192 PERL_UNUSED_ARG(namegv); \
193 PERL_UNUSED_ARG(ckobj); \
194 strigram_walk_args(entersubop, &pushop, &selfop, &argop, &cvop); \
195 if (argop == selfop) return entersubop; \
196 if (OpSIBLING(selfop) != argop) return entersubop; \
197 if (!strigram_simple_op(selfop) || !strigram_simple_op(argop)) \
198 return entersubop; \
199 OpMORESIB_set(pushop, cvop); \
200 OpLASTSIB_set(argop, NULL); \
201 OpLASTSIB_set(selfop, NULL); \
202 newop = newBINOP(OP_NULL, 0, selfop, argop); \
203 newop->op_type = OP_CUSTOM; \
204 newop->op_ppaddr = pp_func; \
205 op_free(entersubop); \
206 return newop; \
207 }
208  
209 0 ▶STRIGRAM_CK_UNOP(ck_strigram_clear, pp_strigram_clear)
Branch: 2 branches
BranchTrueFalseTotal
STRIGRAM_CK_UNOP(ck_strigram_clear, pp_strigram_clear) 0 0 0
STRIGRAM_CK_UNOP(ck_strigram_clear, pp_strigram_clear) 0 0 0
210 0 ▶STRIGRAM_CK_UNOP(ck_strigram_optimize, pp_strigram_optimize)
Branch: 2 branches
BranchTrueFalseTotal
STRIGRAM_CK_UNOP(ck_strigram_optimize, pp_strigram_optimize) 0 0 0
STRIGRAM_CK_UNOP(ck_strigram_optimize, pp_strigram_optimize) 0 0 0
211 0 ▶STRIGRAM_CK_UNOP(ck_strigram_doc_count, pp_strigram_doc_count)
Branch: 2 branches
BranchTrueFalseTotal
STRIGRAM_CK_UNOP(ck_strigram_doc_count, pp_strigram_doc_count) 0 0 0
STRIGRAM_CK_UNOP(ck_strigram_doc_count, pp_strigram_doc_count) 0 0 0
212 0 ▶STRIGRAM_CK_UNOP(ck_strigram_trigram_count, pp_strigram_trigram_count)
Branch: 2 branches
BranchTrueFalseTotal
STRIGRAM_CK_UNOP(ck_strigram_trigram_count, pp_strigram_trigram_count) 0 0 0
STRIGRAM_CK_UNOP(ck_strigram_trigram_count, pp_strigram_trigram_count) 0 0 0
213 0 ▶STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add)
Branch: 5 branches
BranchTrueFalseTotal
STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_add, pp_strigram_add) 0 0 0
214 0 ▶STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove)
Branch: 5 branches
BranchTrueFalseTotal
STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove) 0 0 0
STRIGRAM_CK_BINOP(ck_strigram_remove, pp_strigram_remove) 0 0 0
215  
216 /* search: BINOP(self, query) with optional compile-time constant limit
217 embedded in op_targ. Falls back to XS when limit is a runtime variable. */
218 static OP *
219 0 ck_strigram_search(pTHX_ OP *entersubop, GV *namegv, SV *ckobj)
220 {
221 OP *pushop, *selfop, *argop, *cvop;
222 OP *queryop, *limitop, *newop;
223 PADOFFSET limit_val;
224 PERL_UNUSED_ARG(namegv);
225 PERL_UNUSED_ARG(ckobj);
226  
227 0 strigram_walk_args(entersubop, &pushop, &selfop, &argop, &cvop);
228  
229 0 ▶ if (argop == selfop) return entersubop; /* no query arg */
Branch: 1 branch
BranchTrueFalseTotal
if (argop == selfop) return entersubop; /* no query arg */ 0 0 0
230  
231 0 ▶ queryop = OpSIBLING(selfop);
Branch: 1 branch
BranchTrueFalseTotal
queryop = OpSIBLING(selfop); 0 0 0
232 0 limit_val = 0; /* 0 means pp_ uses default 10 */
233  
234 0 ▶ if (queryop == argop) {
Branch: 1 branch
BranchTrueFalseTotal
if (queryop == argop) { 0 0 0
235 /* $idx->search($query) — no limit supplied */
236 0 ▶ if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop))
Branch: 2 branches
BranchTrueFalseTotal
if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop)) 0 0 0
if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop)) 0 0 0
237 0 return entersubop;
238 0 OpMORESIB_set(pushop, cvop);
239 0 OpLASTSIB_set(queryop, NULL);
240 0 OpLASTSIB_set(selfop, NULL);
241 } else {
242 /* $idx->search($query, $limit) */
243 0 ▶ limitop = OpSIBLING(queryop);
Branch: 1 branch
BranchTrueFalseTotal
limitop = OpSIBLING(queryop); 0 0 0
244 0 ▶ if (limitop != argop) return entersubop; /* > 2 extra args */
Branch: 1 branch
BranchTrueFalseTotal
if (limitop != argop) return entersubop; /* > 2 extra args */ 0 0 0
245 /* Only inline when limit is a compile-time constant */
246 0 ▶ if (limitop->op_type != OP_CONST) return entersubop;
Branch: 1 branch
BranchTrueFalseTotal
if (limitop->op_type != OP_CONST) return entersubop; 0 0 0
247 0 ▶ if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop))
Branch: 2 branches
BranchTrueFalseTotal
if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop)) 0 0 0
if (!strigram_simple_op(selfop) || !strigram_simple_op(queryop)) 0 0 0
248 0 return entersubop;
249 0 limit_val = (PADOFFSET)SvUV(cSVOPx(limitop)->op_sv);
250 0 ▶ if (limit_val == 0) limit_val = 10;
Branch: 1 branch
BranchTrueFalseTotal
if (limit_val == 0) limit_val = 10; 0 0 0
251 0 OpMORESIB_set(pushop, cvop);
252 0 OpLASTSIB_set(queryop, NULL);
253 0 OpLASTSIB_set(selfop, NULL);
254 0 OpLASTSIB_set(limitop, NULL); /* clear before freeing */
255 0 op_free(limitop);
256 }
257  
258 0 newop = newBINOP(OP_NULL, 0, selfop, queryop);
259 0 newop->op_type = OP_CUSTOM;
260 0 newop->op_ppaddr = pp_strigram_search;
261 0 newop->op_targ = limit_val;
262  
263 0 op_free(entersubop);
264 0 return newop;
265 }
266  
267 /* ======================================================
268 XS module (fallbacks for non-optimisable call sites)
269 ====================================================== */
270  
271 MODULE = Search::Trigram PACKAGE = Search::Trigram
272  
273 SV *
274 new(class)
275 const char *class
276 CODE:
277 28 strigram_t *idx = strigram_new();
278 28 SV *obj = newSV(0);
279 28 sv_setref_pv(obj, class, (void *)idx);
280 28 RETVAL = obj;
281 OUTPUT:
282 RETVAL
283  
284 UV
285 add(self, text)
286 SV *self
287 SV *text
288 CODE:
289 10040 strigram_t *idx = STRIGRAM_FROM_SV(self);
290 STRLEN len;
291 10040 const char *str = SvPVutf8(text, len);
292 10040 ▶ RETVAL = (UV)strigram_add(idx, str, (uint32_t)len);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (UV)strigram_add(idx, str, (uint32_t)len); 10003 37 10040
293 OUTPUT:
294 RETVAL
295  
296 SV *
297 search(self, query, ...)
298 SV *self
299 SV *query
300 CODE:
301 20 strigram_t *idx = STRIGRAM_FROM_SV(self);
302 20 ▶ uint32_t limit = (items > 2) ? (uint32_t)SvUV(ST(2)) : 10;
Branch: 1 branch
BranchTrueFalseTotal
uint32_t limit = (items > 2) ? (uint32_t)SvUV(ST(2)) : 10; 2 18 20
303 STRLEN qlen;
304 20 const char *qstr = SvPVutf8(query, qlen);
305 20 uint32_t rcount = 0;
306 strigram_result_t *results =
307 20 strigram_search(idx, qstr, (uint32_t)qlen, limit, &rcount);
308 20 AV *av = newAV();
309 20 ▶ if (results) {
Branch: 1 branch
BranchTrueFalseTotal
if (results) { 15 5 20
310 uint32_t i;
311 38 ▶ for (i = 0; i < rcount; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < rcount; i++) { 23 15 38
312 23 HV *hv = newHV();
313 23 hv_stores(hv, "doc_id", newSVuv(results[i].doc_id));
314 23 hv_stores(hv, "score", newSVnv(results[i].score));
315 23 hv_stores(hv, "text",
316 newSVpvn_flags(results[i].text, results[i].text_len,
317 SVf_UTF8));
318 23 av_push(av, newRV_noinc((SV *)hv));
319 }
320 15 strigram_results_free(results);
321 }
322 20 RETVAL = newRV_noinc((SV *)av);
323 OUTPUT:
324 RETVAL
325  
326 void
327 remove(self, doc_id)
328 SV *self
329 UV doc_id
330 CODE:
331 5 strigram_remove(STRIGRAM_FROM_SV(self), (uint32_t)doc_id);
332  
333 void
334 optimize(self)
335 SV *self
336 CODE:
337 4 strigram_optimize(STRIGRAM_FROM_SV(self));
338  
339 void
340 clear(self)
341 SV *self
342 CODE:
343 1 strigram_clear(STRIGRAM_FROM_SV(self));
344  
345 UV
346 doc_count(self)
347 SV *self
348 CODE:
349 8 ▶ RETVAL = (UV)strigram_doc_count(STRIGRAM_FROM_SV(self));
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (UV)strigram_doc_count(STRIGRAM_FROM_SV(self)); 0 8 8
350 OUTPUT:
351 RETVAL
352  
353 UV
354 trigram_count(self)
355 SV *self
356 CODE:
357 5 ▶ RETVAL = (UV)strigram_trigram_count(STRIGRAM_FROM_SV(self));
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (UV)strigram_trigram_count(STRIGRAM_FROM_SV(self)); 0 5 5
358 OUTPUT:
359 RETVAL
360  
361 void
362 DESTROY(self)
363 SV *self
364 CODE:
365 28 strigram_free(STRIGRAM_FROM_SV(self));
366  
367 BOOT:
368 {
369 6 SV *empty = newSViv(0);
370 CV *cv;
371  
372 6 XopENTRY_set(&xop_strigram_add, xop_name, "strigram_add");
373 6 XopENTRY_set(&xop_strigram_add, xop_desc, "trigram index: add document");
374 6 XopENTRY_set(&xop_strigram_add, xop_class, OA_BINOP);
375 6 Perl_custom_op_register(aTHX_ pp_strigram_add, &xop_strigram_add);
376  
377 6 XopENTRY_set(&xop_strigram_search, xop_name, "strigram_search");
378 6 XopENTRY_set(&xop_strigram_search, xop_desc, "trigram index: search");
379 6 XopENTRY_set(&xop_strigram_search, xop_class, OA_BINOP);
380 6 Perl_custom_op_register(aTHX_ pp_strigram_search, &xop_strigram_search);
381  
382 6 XopENTRY_set(&xop_strigram_remove, xop_name, "strigram_remove");
383 6 XopENTRY_set(&xop_strigram_remove, xop_desc, "trigram index: remove document");
384 6 XopENTRY_set(&xop_strigram_remove, xop_class, OA_BINOP);
385 6 Perl_custom_op_register(aTHX_ pp_strigram_remove, &xop_strigram_remove);
386  
387 6 XopENTRY_set(&xop_strigram_clear, xop_name, "strigram_clear");
388 6 XopENTRY_set(&xop_strigram_clear, xop_desc, "trigram index: clear");
389 6 XopENTRY_set(&xop_strigram_clear, xop_class, OA_UNOP);
390 6 Perl_custom_op_register(aTHX_ pp_strigram_clear, &xop_strigram_clear);
391  
392 6 XopENTRY_set(&xop_strigram_optimize, xop_name, "strigram_optimize");
393 6 XopENTRY_set(&xop_strigram_optimize, xop_desc, "trigram index: optimize");
394 6 XopENTRY_set(&xop_strigram_optimize, xop_class, OA_UNOP);
395 6 Perl_custom_op_register(aTHX_ pp_strigram_optimize, &xop_strigram_optimize);
396  
397 6 XopENTRY_set(&xop_strigram_doc_count, xop_name, "strigram_doc_count");
398 6 XopENTRY_set(&xop_strigram_doc_count, xop_desc, "trigram index: doc_count");
399 6 XopENTRY_set(&xop_strigram_doc_count, xop_class, OA_UNOP);
400 6 Perl_custom_op_register(aTHX_ pp_strigram_doc_count, &xop_strigram_doc_count);
401  
402 6 XopENTRY_set(&xop_strigram_trigram_count, xop_name, "strigram_trigram_count");
403 6 XopENTRY_set(&xop_strigram_trigram_count, xop_desc, "trigram index: trigram_count");
404 6 XopENTRY_set(&xop_strigram_trigram_count, xop_class, OA_UNOP);
405 6 Perl_custom_op_register(aTHX_ pp_strigram_trigram_count, &xop_strigram_trigram_count);
406  
407 6 cv = get_cv("Search::Trigram::add", 0);
408 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_add, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_add, empty); 6 0 6
409  
410 6 cv = get_cv("Search::Trigram::search", 0);
411 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_search, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_search, empty); 6 0 6
412  
413 6 cv = get_cv("Search::Trigram::remove", 0);
414 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_remove, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_remove, empty); 6 0 6
415  
416 6 cv = get_cv("Search::Trigram::clear", 0);
417 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_clear, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_clear, empty); 6 0 6
418  
419 6 cv = get_cv("Search::Trigram::optimize", 0);
420 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_optimize, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_optimize, empty); 6 0 6
421  
422 6 cv = get_cv("Search::Trigram::doc_count", 0);
423 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_doc_count, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_doc_count, empty); 6 0 6
424  
425 6 cv = get_cv("Search::Trigram::trigram_count", 0);
426 6 ▶ if (cv) cv_set_call_checker(cv, ck_strigram_trigram_count, empty);
Branch: 1 branch
BranchTrueFalseTotal
if (cv) cv_set_call_checker(cv, ck_strigram_trigram_count, empty); 6 0 6
427  
428 6 SvREFCNT_dec(empty);
429 }
↑ Summary strigram.c »