Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 10993
Merged at revision: 11138
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 81 lines (+12/-15)
2 files modified
src/context/static_context.cpp (+0/-4)
src/runtime/booleans/BooleanImpl.cpp (+12/-11)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+137413@code.launchpad.net

Commit message

small optimization in comparison operators + mafe string and jsoniq modules pure builtin

Description of the change

small optimization in comparison operators + mafe string and jsoniq modules pure builtin

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2012-12-02T19-49-42.518Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/context/static_context.cpp'
2--- src/context/static_context.cpp 2012-11-17 00:57:54 +0000
3+++ src/context/static_context.cpp 2012-12-02 07:31:21 +0000
4@@ -590,12 +590,8 @@
5 {
6 return (ns == ZORBA_MATH_FN_NS ||
7 ns == ZORBA_INTROSP_SCTX_FN_NS ||
8- ns == ZORBA_STRING_FN_NS ||
9 ns == ZORBA_JSON_FN_NS ||
10 ns == ZORBA_XQDOC_FN_NS ||
11-#ifdef ZORBA_WITH_JSON
12- ns == JSONIQ_FN_NS ||
13-#endif
14 ns == ZORBA_URI_FN_NS ||
15 ns == ZORBA_RANDOM_FN_NS ||
16 ns == ZORBA_FETCH_FN_NS ||
17
18=== modified file 'src/runtime/booleans/BooleanImpl.cpp'
19--- src/runtime/booleans/BooleanImpl.cpp 2012-09-19 21:16:15 +0000
20+++ src/runtime/booleans/BooleanImpl.cpp 2012-12-02 07:31:21 +0000
21@@ -629,21 +629,22 @@
22 store::SchemaTypeCode type1 = item1->getTypeCode();
23
24 // all untyped Atomics to String
25- if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC))
26+ if (type0 == store::XS_UNTYPED_ATOMIC)
27 {
28- GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);
29-
30- if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))
31+ if (type1 == store::XS_UNTYPED_ATOMIC)
32 {
33- GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc);
34+ castItem0.transfer(item0);
35+ castItem1.transfer(item1);
36 }
37 else
38 {
39+ GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);
40+
41 if (!GenericCast::promote(castItem1, item1, store::XS_STRING, tm, loc))
42 castItem1.transfer(item1);
43 }
44 }
45- else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))
46+ else if (type1 == store::XS_UNTYPED_ATOMIC)
47 {
48 if (!GenericCast::promote(castItem0, item0, store::XS_STRING, tm, loc))
49 castItem0.transfer(item0);
50@@ -810,7 +811,7 @@
51 store::SchemaTypeCode type0 = item0->getTypeCode();
52 store::SchemaTypeCode type1 = item1->getTypeCode();
53
54- if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC))
55+ if (type0 == store::XS_UNTYPED_ATOMIC)
56 {
57 if (TypeOps::is_numeric(type1))
58 {
59@@ -818,10 +819,10 @@
60
61 GenericCast::promote(castItem1, item1, store::XS_DOUBLE, tm, loc);
62 }
63- else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))
64+ else if (type1 == store::XS_UNTYPED_ATOMIC)
65 {
66- GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);
67- GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc);
68+ castItem0.transfer(item0);
69+ castItem1.transfer(item1);
70 }
71 else if (TypeOps::is_subtype(type1, store::XS_STRING))
72 {
73@@ -834,7 +835,7 @@
74 castItem1.transfer(item1);
75 }
76 }
77- else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))
78+ else if (type1 == store::XS_UNTYPED_ATOMIC)
79 {
80 if (TypeOps::is_numeric(type0))
81 {

Subscribers

People subscribed via source and target branches