Recursive.xs

filter: Statementstmt 76.9% 10 / 13 Branchbran 48.0% 24 / 50 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 53.9% 34 / 63 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
↑ Summary Recursive_xsgen.cc »
1 #include <xs.h>
2 #include <xs/clone.h>
3 #include <xs/merge.h>
4 #include <xs/export.h>
5 #include <xs/compare.h>
6  
7 using namespace xs;
8  
9 MODULE = Data::Recursive PACKAGE = Data::Recursive
10 PROTOTYPES: DISABLE
11  
12 BOOT {
13 7 ▶ Stash s(__PACKAGE__);
Branch: 1 branch
BranchTrueFalseTotal
Stash s(__PACKAGE__); 7 0 7
14 70 ▶ xs::exp::create_constants(s, {
Branch: 4 branches
BranchTrueFalseTotal
xs::exp::create_constants(s, { 7 0 7
xs::exp::create_constants(s, { 7 0 7
xs::exp::create_constants(s, { 63 7 70
xs::exp::create_constants(s, { 0 0 0
15 {"TRACK_REFS", CloneFlags::TRACK_REFS},
16 {"ARRAY_CONCAT", MergeFlags::ARRAY_CONCAT},
17 {"ARRAY_MERGE", MergeFlags::ARRAY_MERGE},
18 {"COPY_DEST", MergeFlags::COPY_DEST},
19 {"LAZY", MergeFlags::LAZY},
20 {"SKIP_UNDEF", MergeFlags::SKIP_UNDEF},
21 {"DELETE_UNDEF", MergeFlags::DELETE_UNDEF},
22 {"COPY_SOURCE", MergeFlags::COPY_SOURCE},
23 {"COPY_ALL", MergeFlags::COPY_ALL}
24 });
25 7 }
26  
27 Scalar lclone (SV* source) {
28 21 ▶ RETVAL = clone(source, 0);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = clone(source, 0); 19 1 20
RETVAL = clone(source, 0); 19 0 19
29 }
30  
31 Scalar clone (SV* source, int flags = CloneFlags::TRACK_REFS) {
32 12 ▶ RETVAL = clone(source, flags);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = clone(source, flags); 10 1 11
RETVAL = clone(source, flags); 10 0 10
33 }
34  
35 Scalar merge (SV* dest, SV* source, int flags = 0) {
36 8 ▶ RETVAL = merge(Sv(dest), Sv(source), flags);
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = merge(Sv(dest), Sv(source), flags); 8 0 8
RETVAL = merge(Sv(dest), Sv(source), flags); 8 0 8
37 }
38  
39 Scalar hash_merge (Hash dest, Hash source, int flags = 0) {
40 21 ▶ auto result = merge(dest, source, flags);
Branch: 2 branches
BranchTrueFalseTotal
auto result = merge(dest, source, flags); 20 0 20
auto result = merge(dest, source, flags); 19 1 20
41 19 ▶ if (result == dest) RETVAL = ST(0); // hash not changed - return the same Ref for speed
Branch: 3 branches
BranchTrueFalseTotal
if (result == dest) RETVAL = ST(0); // hash not changed - return the same Ref for speed 19 0 19
if (result == dest) RETVAL = ST(0); // hash not changed - return the same Ref for speed 14 5 19
if (result == dest) RETVAL = ST(0); // hash not changed - return the same Ref for speed 14 0 14
42 5 ▶ else RETVAL = Ref::create(result);
Branch: 1 branch
BranchTrueFalseTotal
else RETVAL = Ref::create(result); 5 0 5
43 }
44  
45 Scalar array_merge (Array dest, Array source, int flags = 0) {
46 0 ▶ auto result = merge(dest, source, flags);
Branch: 2 branches
BranchTrueFalseTotal
auto result = merge(dest, source, flags); 0 0 0
auto result = merge(dest, source, flags); 0 0 0
47 0 ▶ if (result == dest) RETVAL = ST(0); // array not changed - return the same Ref for speed
Branch: 3 branches
BranchTrueFalseTotal
if (result == dest) RETVAL = ST(0); // array not changed - return the same Ref for speed 0 0 0
if (result == dest) RETVAL = ST(0); // array not changed - return the same Ref for speed 0 0 0
if (result == dest) RETVAL = ST(0); // array not changed - return the same Ref for speed 0 0 0
48 0 ▶ else RETVAL = Ref::create(result);
Branch: 1 branch
BranchTrueFalseTotal
else RETVAL = Ref::create(result); 0 0 0
49 }
50  
51 57 ▶bool compare (Sv first, Sv second)
Branch: 2 branches
BranchTrueFalseTotal
bool compare (Sv first, Sv second) 57 0 57
bool compare (Sv first, Sv second) 29 28 57
↑ Summary Recursive_xsgen.cc »