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
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2012-11-17 00:57:54 +0000
+++ src/context/static_context.cpp 2012-12-02 07:31:21 +0000
@@ -590,12 +590,8 @@
590 {590 {
591 return (ns == ZORBA_MATH_FN_NS ||591 return (ns == ZORBA_MATH_FN_NS ||
592 ns == ZORBA_INTROSP_SCTX_FN_NS ||592 ns == ZORBA_INTROSP_SCTX_FN_NS ||
593 ns == ZORBA_STRING_FN_NS ||
594 ns == ZORBA_JSON_FN_NS ||593 ns == ZORBA_JSON_FN_NS ||
595 ns == ZORBA_XQDOC_FN_NS ||594 ns == ZORBA_XQDOC_FN_NS ||
596#ifdef ZORBA_WITH_JSON
597 ns == JSONIQ_FN_NS ||
598#endif
599 ns == ZORBA_URI_FN_NS ||595 ns == ZORBA_URI_FN_NS ||
600 ns == ZORBA_RANDOM_FN_NS ||596 ns == ZORBA_RANDOM_FN_NS ||
601 ns == ZORBA_FETCH_FN_NS ||597 ns == ZORBA_FETCH_FN_NS ||
602598
=== modified file 'src/runtime/booleans/BooleanImpl.cpp'
--- src/runtime/booleans/BooleanImpl.cpp 2012-09-19 21:16:15 +0000
+++ src/runtime/booleans/BooleanImpl.cpp 2012-12-02 07:31:21 +0000
@@ -629,21 +629,22 @@
629 store::SchemaTypeCode type1 = item1->getTypeCode();629 store::SchemaTypeCode type1 = item1->getTypeCode();
630630
631 // all untyped Atomics to String631 // all untyped Atomics to String
632 if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC))632 if (type0 == store::XS_UNTYPED_ATOMIC)
633 {633 {
634 GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);634 if (type1 == store::XS_UNTYPED_ATOMIC)
635
636 if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))
637 {635 {
638 GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc);636 castItem0.transfer(item0);
637 castItem1.transfer(item1);
639 }638 }
640 else639 else
641 {640 {
641 GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);
642
642 if (!GenericCast::promote(castItem1, item1, store::XS_STRING, tm, loc))643 if (!GenericCast::promote(castItem1, item1, store::XS_STRING, tm, loc))
643 castItem1.transfer(item1);644 castItem1.transfer(item1);
644 }645 }
645 }646 }
646 else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))647 else if (type1 == store::XS_UNTYPED_ATOMIC)
647 {648 {
648 if (!GenericCast::promote(castItem0, item0, store::XS_STRING, tm, loc))649 if (!GenericCast::promote(castItem0, item0, store::XS_STRING, tm, loc))
649 castItem0.transfer(item0);650 castItem0.transfer(item0);
@@ -810,7 +811,7 @@
810 store::SchemaTypeCode type0 = item0->getTypeCode();811 store::SchemaTypeCode type0 = item0->getTypeCode();
811 store::SchemaTypeCode type1 = item1->getTypeCode();812 store::SchemaTypeCode type1 = item1->getTypeCode();
812813
813 if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC))814 if (type0 == store::XS_UNTYPED_ATOMIC)
814 {815 {
815 if (TypeOps::is_numeric(type1))816 if (TypeOps::is_numeric(type1))
816 {817 {
@@ -818,10 +819,10 @@
818819
819 GenericCast::promote(castItem1, item1, store::XS_DOUBLE, tm, loc);820 GenericCast::promote(castItem1, item1, store::XS_DOUBLE, tm, loc);
820 }821 }
821 else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))822 else if (type1 == store::XS_UNTYPED_ATOMIC)
822 {823 {
823 GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc);824 castItem0.transfer(item0);
824 GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc);825 castItem1.transfer(item1);
825 }826 }
826 else if (TypeOps::is_subtype(type1, store::XS_STRING))827 else if (TypeOps::is_subtype(type1, store::XS_STRING))
827 {828 {
@@ -834,7 +835,7 @@
834 castItem1.transfer(item1);835 castItem1.transfer(item1);
835 }836 }
836 }837 }
837 else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC))838 else if (type1 == store::XS_UNTYPED_ATOMIC)
838 {839 {
839 if (TypeOps::is_numeric(type0))840 if (TypeOps::is_numeric(type0))
840 {841 {

Subscribers

People subscribed via source and target branches