diff options
author | Juerg Billeter <j@bitron.ch> | 2007-07-23 20:23:35 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2007-07-23 20:23:35 +0000 |
commit | f639be720b8a8e97a7a7b8409e9de3286a9afc18 (patch) | |
tree | e1909018a3db87f44bb43efbd9de533e27300580 /vala/valaexpressionstatement.vala | |
parent | 657a9a4ccc04635aa06ca499d548113088cd9c29 (diff) | |
download | vala-f639be720b8a8e97a7a7b8409e9de3286a9afc18.tar.gz |
use setters for non-construction properties in creation methods to improve
2007-07-23 Juerg Billeter <j@bitron.ch>
* vala/valaexpressionstatement.vala, vala/valasemanticanalyzer.vala,
gobject/valacodegeneratorassignment.vala,
gobject/valacodegeneratorclass.vala,
gobject/valacodegeneratormethod.vala: use setters for non-construction
properties in creation methods to improve performance
svn path=/trunk/; revision=377
Diffstat (limited to 'vala/valaexpressionstatement.vala')
-rw-r--r-- | vala/valaexpressionstatement.vala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vala/valaexpressionstatement.vala b/vala/valaexpressionstatement.vala index 58925b6d9..2a83b9bf4 100644 --- a/vala/valaexpressionstatement.vala +++ b/vala/valaexpressionstatement.vala @@ -65,19 +65,22 @@ public class Vala.ExpressionStatement : CodeNode, Statement { } /** - * Returns whether this statement sets a property. + * Returns the property this statement sets, if any. * - * @return true if this statement sets a property, false otherwise + * @return the property this statement sets, or null if it doesn't set + * a property */ - public bool sets_property () { + public Property assigned_property () { if (expression is Assignment) { var assign = (Assignment) expression; if (assign.left is MemberAccess) { var ma = (MemberAccess) assign.left; - return (ma.symbol_reference is Property); + if (ma.symbol_reference is Property) { + return (Property) ma.symbol_reference; + } } } - return false; + return null; } } |