summaryrefslogtreecommitdiff
path: root/vala/valaparser.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-09-29 18:15:54 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-09-30 16:03:29 +0200
commit9811ebe2f9b984bca96248183fc412fa8d049c60 (patch)
treeb5618812013aa513b85fcd4d20fe1b734f3498ef /vala/valaparser.vala
parent325c81d6f8db52a9172597766930797adfa6f04a (diff)
downloadvala-9811ebe2f9b984bca96248183fc412fa8d049c60.tar.gz
vala: Micro optimizations
Diffstat (limited to 'vala/valaparser.vala')
-rw-r--r--vala/valaparser.vala12
1 files changed, 6 insertions, 6 deletions
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 754d50cb5..37d34ec81 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -779,7 +779,7 @@ public class Vala.Parser : CodeVisitor {
if (init_list.size > 0 && inner is MemberAccess) {
// struct creation expression
- var member = (MemberAccess) inner;
+ unowned MemberAccess member = (MemberAccess) inner;
member.creation_member = true;
var expr = new ObjectCreationExpression (member, src);
@@ -1000,8 +1000,8 @@ public class Vala.Parser : CodeVisitor {
var expr = parse_expression ();
- var call = expr as MethodCall;
- var object_creation = expr as ObjectCreationExpression;
+ unowned MethodCall? call = expr as MethodCall;
+ unowned ObjectCreationExpression? object_creation = expr as ObjectCreationExpression;
if (call == null && object_creation == null) {
Report.error (expr.source_reference, "syntax error, expected method call");
throw new ParseError.SYNTAX ("expected method call");
@@ -1054,7 +1054,7 @@ public class Vala.Parser : CodeVisitor {
if (operator != UnaryOperator.NONE) {
next ();
var op = parse_unary_expression ();
- var lit = op as IntegerLiteral;
+ unowned IntegerLiteral? lit = op as IntegerLiteral;
if (lit != null) {
if (operator == UnaryOperator.PLUS) {
return lit;
@@ -1852,7 +1852,7 @@ public class Vala.Parser : CodeVisitor {
var constant_type = parse_type (false, false);
// constant arrays don't own their element
- var array_type = constant_type as ArrayType;
+ unowned ArrayType? array_type = constant_type as ArrayType;
if (array_type != null) {
array_type.element_type.value_owned = false;
}
@@ -2623,7 +2623,7 @@ public class Vala.Parser : CodeVisitor {
type = parse_inline_array_type (type);
// constant arrays don't own their element
- var array_type = type as ArrayType;
+ unowned ArrayType? array_type = type as ArrayType;
if (array_type != null) {
array_type.element_type.value_owned = false;
}