diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-07-22 15:44:53 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-08-09 05:20:37 +0000 |
commit | c3cbbf362c769b065fd0586b0510d043cbae92a4 (patch) | |
tree | d87c6c2345a22460b7dfa2113056a18b22fb88dc /src/qml/qml/qqmlxmlhttprequest.cpp | |
parent | 4edeaa48abf8caccb62e623c32f97b0897c3167f (diff) |
Qml: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.
Change-Id: I13e4d5b091877319984c1ddaed4da8dc59a7c0a3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 201d634411..3f56cc24e2 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -502,7 +502,7 @@ ReturnedValue NodePrototype::method_get_firstChild(CallContext *ctx) if (r->d()->d->children.isEmpty()) return Encode::null(); else - return Node::create(scope.engine, r->d()->d->children.first()); + return Node::create(scope.engine, r->d()->d->children.constFirst()); } ReturnedValue NodePrototype::method_get_lastChild(CallContext *ctx) @@ -515,7 +515,7 @@ ReturnedValue NodePrototype::method_get_lastChild(CallContext *ctx) if (r->d()->d->children.isEmpty()) return Encode::null(); else - return Node::create(scope.engine, r->d()->d->children.last()); + return Node::create(scope.engine, r->d()->d->children.constLast()); } ReturnedValue NodePrototype::method_get_previousSibling(CallContext *ctx) |