From: <ev...@us...> - 2011-07-04 11:21:14
|
Revision: 1600 http://rails.svn.sourceforge.net/rails/?rev=1600&view=rev Author: evos Date: 2011-07-04 11:21:08 +0000 (Mon, 04 Jul 2011) Log Message: ----------- Updated ModelObject.update() to return immediately if there are no observers. This saves unnecessary overhead in constructing unused View text. Modified Paths: -------------- trunk/18xx/rails/game/model/ModelObject.java Modified: trunk/18xx/rails/game/model/ModelObject.java =================================================================== --- trunk/18xx/rails/game/model/ModelObject.java 2011-07-04 11:12:54 UTC (rev 1599) +++ trunk/18xx/rails/game/model/ModelObject.java 2011-07-04 11:21:08 UTC (rev 1600) @@ -73,7 +73,7 @@ */ public void update() { /* Notify the observers about the change */ - notifyViewObjects(); + if (countObservers() > 0) notifyViewObjects(); /* Also update all model objects that depend on this one */ if (dependents != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |