diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-10-30 15:47:02 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-01 11:50:31 +0100 |
commit | 706ff17703b8f6f3593bbf59f1bf9497b1dc3c4e (patch) | |
tree | 0e8f3b22c560f89d3557b75343e9bb02c73fc095 /vapigen | |
parent | 0f65d306f5a2eca7ea798e5c835cf66b6e327c8e (diff) | |
download | vala-706ff17703b8f6f3593bbf59f1bf9497b1dc3c4e.tar.gz |
Avoid some string copying
Diffstat (limited to 'vapigen')
-rw-r--r-- | vapigen/valagidlparser.vala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index ceb6b3315..553d1c855 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -112,7 +112,7 @@ public class Vala.GIdlParser : CodeVisitor { string metadata; FileUtils.get_contents (metadata_filename, out metadata, null); - foreach (string line in metadata.split ("\n")) { + foreach (unowned string line in metadata.split ("\n")) { if (line.has_prefix ("#")) { // ignore comment lines continue; @@ -750,7 +750,7 @@ public class Vala.GIdlParser : CodeVisitor { if (suppress_throws == false && error_types != null) { var type_args = eval (error_types).split (","); - foreach (string type_arg in type_args) { + foreach (unowned string type_arg in type_args) { cb.add_error_type (parse_type_from_string (type_arg, true)); } } @@ -921,7 +921,7 @@ public class Vala.GIdlParser : CodeVisitor { } else if (nv[0] == "deprecated_since") { cl.set_attribute_string ("Version", "deprecated_since", eval (nv[1])); } else if (nv[0] == "type_parameters") { - foreach (string type_param_name in eval (nv[1]).split (",")) { + foreach (unowned string type_param_name in eval (nv[1]).split (",")) { cl.add_type_parameter (new TypeParameter (type_param_name, current_source_reference)); } } else if (nv[0] == "experimental") { @@ -2552,7 +2552,7 @@ public class Vala.GIdlParser : CodeVisitor { if (val.has_prefix ("\"") && val.has_suffix ("\"")) { p.initializer = new StringLiteral (val, param_type.source_reference); } else { - foreach (var member in val.split (".")) { + foreach (unowned string member in val.split (".")) { p.initializer = new MemberAccess (p.initializer, member, param_type.source_reference); } } @@ -2597,7 +2597,7 @@ public class Vala.GIdlParser : CodeVisitor { if (suppress_throws == false && error_types != null) { var type_args = eval (error_types).split (","); - foreach (string type_arg in type_args) { + foreach (unowned string type_arg in type_args) { m.add_error_type (parse_type_from_string (type_arg, true)); } } |