(int ncap)
| 131 | |
| 132 | // init() reinitializes an existing Machine for re-use on a new input. |
| 133 | void init(int ncap) { |
| 134 | // length change need new arrays |
| 135 | this.ncap = ncap; |
| 136 | if (ncap > matchcap.length) { |
| 137 | initNewCap(ncap); |
| 138 | } else { |
| 139 | resetCap(ncap); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | private void resetCap(int ncap) { |
| 144 | // same size just reset to 0 |
no test coverage detected