Permalink
Browse files

Fixed bug on buffer extension.

  • Loading branch information...
1 parent b4da90e commit 610b429bc1e7754c45bce7c7c1053406088b8ebd masaruh committed Feb 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/org/atilika/kuromoji/trie/DoubleArrayTrie.java
@@ -266,7 +266,7 @@ private int findBase(int index, Node[] nodes){
*/
int nextIndex = index + base + node.getKey();
- while(baseBuffer.capacity() < nextIndex) {
+ if(baseBuffer.capacity() <= nextIndex) {
int newLength = nextIndex + 1;
IntBuffer newBaseBuffer = ByteBuffer.allocate(newLength * 4).asIntBuffer();
baseBuffer.rewind();

0 comments on commit 610b429

Please sign in to comment.