equal
deleted
inserted
replaced
690 /// given element. |
690 /// given element. |
691 int insert(const Item& item) { |
691 int insert(const Item& item) { |
692 int cdx = newClass(); |
692 int cdx = newClass(); |
693 classes[cdx].prev = -1; |
693 classes[cdx].prev = -1; |
694 classes[cdx].next = firstClass; |
694 classes[cdx].next = firstClass; |
|
695 if (firstClass != -1) { |
|
696 classes[firstClass].prev = cdx; |
|
697 } |
695 firstClass = cdx; |
698 firstClass = cdx; |
696 |
699 |
697 int idx = newItem(); |
700 int idx = newItem(); |
698 items[idx].item = item; |
701 items[idx].item = item; |
699 items[idx].cls = cdx; |
702 items[idx].cls = cdx; |