| 879 | } |
| 880 | |
| 881 | func (ac *arrayContainer) negateRange(buffer []uint16, startIndex, lastIndex, startRange, lastRange int) { |
| 882 | // compute the negation into buffer |
| 883 | outPos := 0 |
| 884 | inPos := startIndex // value here always >= valInRange, |
| 885 | // until it is exhausted |
| 886 | // n.b., we can start initially exhausted. |
| 887 | |
| 888 | valInRange := startRange |
| 889 | for ; valInRange < lastRange && inPos <= lastIndex; valInRange++ { |
| 890 | if uint16(valInRange) != ac.content[inPos] { |
| 891 | buffer[outPos] = uint16(valInRange) |
| 892 | outPos++ |
| 893 | } else { |
| 894 | inPos++ |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | // if there are extra items (greater than the biggest |
| 899 | // pre-existing one in range), buffer them |
| 900 | for ; valInRange < lastRange; valInRange++ { |
| 901 | buffer[outPos] = uint16(valInRange) |
| 902 | outPos++ |
| 903 | } |
| 904 | |
| 905 | if outPos != len(buffer) { |
| 906 | panic("negateRange: internal bug") |
| 907 | } |
| 908 | |
| 909 | for i, item := range buffer { |
| 910 | ac.content[i+startIndex] = item |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | func (ac *arrayContainer) isFull() bool { |
| 915 | return false |