Commit 6013a9c3 authored by feihuaduo's avatar feihuaduo

修复最后一张卡是同名卡时造成的角标越界的问题

parent 603cf96c
......@@ -121,6 +121,7 @@ public class Deck implements Parcelable {
}
if (id > 0) {
builder.append(id);
//如果是最后一张就不用对比下张卡
if(i!=ids.size()-1) {
int id1 = ids.get(i + 1);
//同名卡张数
......@@ -129,6 +130,8 @@ public class Deck implements Parcelable {
if (id1 == id) {
tNum++;
i++;
//如果是倒数第二张就不用对比下下张卡
if(i!=ids.size()-2) {
id1 = ids.get(i + 2);
//如果下下张是同名卡
if (id1 == id) {
......@@ -136,6 +139,7 @@ public class Deck implements Parcelable {
i++;
}
}
}
//如果有同名卡
if (tNum > 1) {
builder.append("*" + tNum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment