[Fb-contrib-commit] SF.net SVN: fb-contrib: [729] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-12-14 06:40:37
|
Revision: 729 http://svn.sourceforge.net/fb-contrib/?rev=729&view=rev Author: dbrosius Date: 2006-12-13 22:40:36 -0800 (Wed, 13 Dec 2006) Log Message: ----------- When looking for a scope block with target, if one is found, don't automatically return it, but look for smaller children first. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-14 00:05:21 UTC (rev 728) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-14 06:40:36 UTC (rev 729) @@ -273,9 +273,10 @@ * @return the scope block found or null */ private ScopeBlock findScopeBlockWithTarget(ScopeBlock sb, int start, int target) { + ScopeBlock parentBlock = null; if ((sb.startLocation < start) && (sb.finishLocation >= start)) { if ((sb.finishLocation <= target) || (sb.isGoto() && !sb.isLoop())) - return sb; + parentBlock = sb; } if (sb.children != null) @@ -287,7 +288,7 @@ } } - return null; + return parentBlock; } /** holds the description of a scope { } block, be it a for, if, while block This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |