Permalink
Browse files

Be more thrifty wrt code buffer.

  • Loading branch information...
1 parent 4f705e9 commit 6407ffb6185af2f23b5c3505ccb4871a54824562 @lopex lopex committed Mar 11, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/org/joni/ArrayCompiler.java
@@ -56,7 +56,8 @@
@Override
protected final void prepare() {
- code = new int[(analyser.stop - analyser.p) * 2 + 1]; // (+1: empty regex)
+ int codeSize = Config.USE_STRING_TEMPLATES ? 8 : ((analyser.getEnd() - analyser.getBegin()) * 2 + 2);
+ code = new int[codeSize];
codeLength = 0;
}

0 comments on commit 6407ffb

Please sign in to comment.