[gxml] Node.vala, NodeList.vala: drop private _str fields for to_string; we wouldn't cash it anyway
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Node.vala, NodeList.vala: drop private _str fields for to_string; we wouldn't cash it anyway
- Date: Sun, 25 Aug 2013 14:42:08 +0000 (UTC)
commit 1a02e1eaa59b9bcf1bb402bde8a9648c226c19bb
Author: Richard Schwarting <aquarichy gmail com>
Date: Sat Aug 24 15:18:33 2013 -0230
Node.vala, NodeList.vala: drop private _str fields for to_string; we wouldn't cash it anyway
gxml/Node.vala | 6 +-----
gxml/NodeList.vala | 7 +++----
2 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/gxml/Node.vala b/gxml/Node.vala
index 090eaa5..687f9dc 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -388,7 +388,6 @@ namespace GXml {
return null;
}
- private string _str;
/**
* Provides a string representation of this node.
*
@@ -405,11 +404,8 @@ namespace GXml {
*/
// TODO: ask Colin Walters about storing docs in GIR files (might have not been him)
public virtual string to_string (bool format = false, int level = 0) {
- _str = "Node(%d:%s)".printf (this.node_type, this.node_name);
- return _str;
+ return "Node(%d:%s)".printf (this.node_type, this.node_name);
}
-
- // TODO: indicate in C that the return value must be freed.
}
}
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index 9aa283f..8e1e4f7 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -670,13 +670,12 @@ namespace GXml {
return new_child;
}
- private string _str;
public string to_string (bool in_line = true) {
- _str = "";
+ string str = "";
foreach (Node node in this) {
- _str += node.to_string ();
+ str += node.to_string ();
}
- return _str;
+ return str;
}
/* ** NodeListIterator ***/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]