Skip to content

Commit

Permalink
要素数が1以下の場合ni
Browse files Browse the repository at this point in the history
git commit src/net/reduls/jada/Trie.java -m要素数が1以下の場合に範囲外アクセスが生じていたのを修正
  • Loading branch information
takeru ohta committed Aug 29, 2010
1 parent 9ee33a5 commit a5ecec2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/net/reduls/jada/Trie.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ public boolean commonPrefixSearch(CodeStream key, Node root) {
int node = root.node;
int last = 0; // set arbitrary initial value but -1
for(;;) {
if(node != root.node) {
if(base[node] < 0) {
if(last==-1 || tailIncluding(-base[node], key))
root.id = bv.rank(node);
return false;
}

if(base[node] < 0) {
if(last==-1 || tailIncluding(-base[node], key))
root.id = bv.rank(node);
return false;
}

if(node != root.node) {
final int terminal = base[node] + charcode[0];
if(chck[terminal] == node) {
root.node = node;
Expand Down

0 comments on commit a5ecec2

Please sign in to comment.