[vala/staging: 6/6] codecontext: Avoid some string copying



commit 7998d4c5a248b398946e29425e81b13854fbe596
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Oct 30 15:47:02 2016 +0100

    codecontext: Avoid some string copying

 vala/valacodecontext.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 0407561..4484c05 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -543,7 +543,7 @@ public class Vala.CodeContext {
                string filename = null;
 
                if (directories != null) {
-                       foreach (string dir in directories) {
+                       foreach (unowned string dir in directories) {
                                filename = Path.build_path ("/", dir, basename);
                                if (FileUtils.test (filename, FileTest.EXISTS)) {
                                        return filename;
@@ -552,7 +552,7 @@ public class Vala.CodeContext {
                }
 
                if (data_dir != null) {
-                       foreach (string dir in Environment.get_system_data_dirs ()) {
+                       foreach (unowned string dir in Environment.get_system_data_dirs ()) {
                                filename = Path.build_path ("/", dir, data_dir, basename);
                                if (FileUtils.test (filename, FileTest.EXISTS)) {
                                        return filename;
@@ -561,7 +561,7 @@ public class Vala.CodeContext {
                }
 
                if (versioned_data_dir != null) {
-                       foreach (string dir in Environment.get_system_data_dirs ()) {
+                       foreach (unowned string dir in Environment.get_system_data_dirs ()) {
                                filename = Path.build_path ("/", dir, versioned_data_dir, basename);
                                if (FileUtils.test (filename, FileTest.EXISTS)) {
                                        return filename;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]