Prospective CI system build fix for Ubuntu 10.04's gcc
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 24 Jun 2013 15:00:28 +0000 (17:00 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 26 Jun 2013 13:45:44 +0000 (15:45 +0200)
Change-Id: I4293c3a75e6a98cafd8f41a68012102628416610
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4/qv4sequenceobject.cpp

index 4cebe96..454b327 100644 (file)
@@ -336,6 +336,36 @@ public:
         return false;
     }
 
+    struct DefaultCompareFunctor
+    {
+        bool operator()(typename Container::value_type lhs, typename Container::value_type rhs)
+        {
+            return convertElementToString(lhs) < convertElementToString(rhs);
+        }
+    };
+
+    struct CompareFunctor
+    {
+        CompareFunctor(QV4::ExecutionContext *ctx, const QV4::Value &compareFn)
+            : m_ctx(ctx), m_compareFn(compareFn)
+        {}
+
+        bool operator()(typename Container::value_type lhs, typename Container::value_type rhs)
+        {
+            QV4::Managed *fun = this->m_compareFn.asManaged();
+            QV4::Value argv[2] = {
+                convertElementToValue(this->m_ctx->engine, lhs),
+                convertElementToValue(this->m_ctx->engine, rhs)
+            };
+            QV4::Value result = fun->call(QV4::Value::fromObject(this->m_ctx->engine->globalObject), argv, 2);
+            return result.toNumber() < 0;
+        }
+
+    private:
+        QV4::ExecutionContext *m_ctx;
+        QV4::Value m_compareFn;
+    };
+
     void sort(QV4::SimpleCallContext *ctx)
     {
         if (m_isReference) {
@@ -344,36 +374,6 @@ public:
             loadReference();
         }
 
-        struct DefaultCompareFunctor
-        {
-            bool operator()(typename Container::value_type lhs, typename Container::value_type rhs)
-            {
-                return convertElementToString(lhs) < convertElementToString(rhs);
-            }
-        };
-
-        struct CompareFunctor
-        {
-            CompareFunctor(QV4::ExecutionContext *ctx, const QV4::Value &compareFn)
-                : m_ctx(ctx), m_compareFn(compareFn)
-            {}
-
-            bool operator()(typename Container::value_type lhs, typename Container::value_type rhs)
-            {
-                QV4::Managed *fun = this->m_compareFn.asManaged();
-                QV4::Value argv[2] = {
-                    convertElementToValue(this->m_ctx->engine, lhs),
-                    convertElementToValue(this->m_ctx->engine, rhs)
-                };
-                QV4::Value result = fun->call(QV4::Value::fromObject(this->m_ctx->engine->globalObject), argv, 2);
-                return result.toNumber() < 0;
-            }
-
-        private:
-            QV4::ExecutionContext *m_ctx;
-            QV4::Value m_compareFn;
-        };
-
         if (ctx->argumentCount == 1 && ctx->arguments[0].asFunctionObject()) {
             QV4::Value compareFn = ctx->arguments[0];
             CompareFunctor cf(ctx, compareFn);