Different behavior on function calls that find nothing - don't decrement the resource count at all
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 23 Oct 2013 14:56:02 +0200
changeset 1387350f8aee0f60
parent 1386 e6853d0d27c4
child 1388 d28e1c58f508
Different behavior on function calls that find nothing - don't decrement the resource count at all
rt/vm/src/main/java/org/apidesign/vm4brwsr/Zips.java
     1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/Zips.java	Tue Oct 22 19:37:49 2013 +0200
     1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/Zips.java	Wed Oct 23 14:56:02 2013 +0200
     1.3 @@ -74,12 +74,14 @@
     1.4                  byte[] checkRes;
     1.5                  if (c instanceof Zips) {
     1.6                      checkRes = ((Zips)c).findRes(res);
     1.7 +                    if (checkRes != null && --skip < 0) {
     1.8 +                        return checkRes;
     1.9 +                    }
    1.10                  } else {
    1.11                      checkRes = callFunction(c, res, skip);
    1.12 -                    skip = 0;
    1.13 -                }
    1.14 -                if (checkRes != null && --skip < 0) {
    1.15 -                    return checkRes;
    1.16 +                    if (checkRes != null) {
    1.17 +                        return checkRes;
    1.18 +                    }
    1.19                  }
    1.20              }
    1.21          }