rwaldhoff    2003/06/30 15:40:53

  Modified:    functor/src/java/org/apache/commons/functor Algorithms.java
  Log:
  refactor slightly to avoid inline assignment
  
  Revision  Changes    Path
  1.4       +10 -4     
jakarta-commons-sandbox/functor/src/java/org/apache/commons/functor/Algorithms.java
  
  Index: Algorithms.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/functor/src/java/org/apache/commons/functor/Algorithms.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Algorithms.java   30 Jun 2003 11:00:16 -0000      1.3
  +++ Algorithms.java   30 Jun 2003 22:40:53 -0000      1.4
  @@ -355,8 +355,14 @@
   
           // if the function returns another function, execute it. stop executing
           // when the function doesn't return another function of the same type.
  -        while(recursiveFunctionClass.isInstance(result = function.evaluate())) {
  -            function = (Function)result;
  +        while(true) {
  +            result = function.evaluate();
  +            if(recursiveFunctionClass.isInstance(result)) {
  +                function = (Function)result;
  +                continue;
  +            } else {
  +                break;
  +            }
           }
   
           return result;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to