diff options
-rw-r--r-- | src/lib/corelib/language/evaluatorscriptclass.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/itemreaderastvisitor.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/value.cpp | 7 | ||||
-rw-r--r-- | src/lib/corelib/language/value.h | 8 |
4 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp index 91f9b241a..fcc920366 100644 --- a/src/lib/corelib/language/evaluatorscriptclass.cpp +++ b/src/lib/corelib/language/evaluatorscriptclass.cpp @@ -148,7 +148,7 @@ private: QScriptValue conditionScope; QScriptValue conditionFileScope; Item *outerItem = data->item->outerItem(); - for (int i = 0; i < value->alternatives().count(); ++i) { + for (size_t i = 0; i < value->alternatives().size(); ++i) { const JSSourceValue::Alternative *alternative = 0; alternative = &value->alternatives().at(i); const Evaluator::FileContextScopes fileCtxScopes diff --git a/src/lib/corelib/language/itemreaderastvisitor.cpp b/src/lib/corelib/language/itemreaderastvisitor.cpp index 4bc629c5e..9d77472c2 100644 --- a/src/lib/corelib/language/itemreaderastvisitor.cpp +++ b/src/lib/corelib/language/itemreaderastvisitor.cpp @@ -315,7 +315,7 @@ void ItemReaderASTVisitor::inheritItem(Item *dst, const Item *src) QBS_CHECK(!sv->baseValue()); const JSSourceValuePtr baseValue = std::static_pointer_cast<JSSourceValue>(it.value()); sv->setBaseValue(baseValue); - for (const JSSourceValue::Alternative &alt : qAsConst(sv->m_alternatives)) + for (const JSSourceValue::Alternative &alt : sv->m_alternatives) alt.value->setBaseValue(baseValue); break; } diff --git a/src/lib/corelib/language/value.cpp b/src/lib/corelib/language/value.cpp index 1b73ccf17..f72cb248c 100644 --- a/src/lib/corelib/language/value.cpp +++ b/src/lib/corelib/language/value.cpp @@ -104,8 +104,9 @@ JSSourceValue::JSSourceValue(const JSSourceValue &other) : Value(other) m_baseValue = other.m_baseValue ? std::static_pointer_cast<JSSourceValue>(other.m_baseValue->clone()) : JSSourceValuePtr(); - for (const Alternative &otherAlt : qAsConst(other.m_alternatives)) - m_alternatives << otherAlt.clone(); + m_alternatives.reserve(other.m_alternatives.size()); + for (const Alternative &otherAlt : other.m_alternatives) + m_alternatives.push_back(otherAlt.clone()); } JSSourceValuePtr JSSourceValue::create(bool createdByPropertiesBlock) @@ -155,7 +156,7 @@ void JSSourceValue::setHasFunctionForm(bool b) void JSSourceValue::setDefiningItem(Item *item) { Value::setDefiningItem(item); - for (const JSSourceValue::Alternative &a : qAsConst(m_alternatives)) + for (const JSSourceValue::Alternative &a : m_alternatives) a.value->setDefiningItem(item); } diff --git a/src/lib/corelib/language/value.h b/src/lib/corelib/language/value.h index 49ca1f51a..6dcefc602 100644 --- a/src/lib/corelib/language/value.h +++ b/src/lib/corelib/language/value.h @@ -44,6 +44,8 @@ #include <tools/codelocation.h> #include <QtCore/qvariant.h> +#include <vector> + namespace qbs { namespace Internal { class Item; @@ -156,8 +158,8 @@ public: JSSourceValuePtr value; }; - const QList<Alternative> &alternatives() const { return m_alternatives; } - void addAlternative(const Alternative &alternative) { m_alternatives.append(alternative); } + const std::vector<Alternative> &alternatives() const { return m_alternatives; } + void addAlternative(const Alternative &alternative) { m_alternatives.push_back(alternative); } void setDefiningItem(Item *item); @@ -168,7 +170,7 @@ private: FileContextPtr m_file; Flags m_flags; JSSourceValuePtr m_baseValue; - QList<Alternative> m_alternatives; + std::vector<Alternative> m_alternatives; }; |