()
| 786 | } |
| 787 | |
| 788 | func (ra *roaringArray) checkKeysSorted() bool { |
| 789 | if len(ra.keys) == 0 || len(ra.keys) == 1 { |
| 790 | return true |
| 791 | } |
| 792 | previous := ra.keys[0] |
| 793 | for nextIdx := 1; nextIdx < len(ra.keys); nextIdx++ { |
| 794 | next := ra.keys[nextIdx] |
| 795 | if previous >= next { |
| 796 | return false |
| 797 | } |
| 798 | previous = next |
| 799 | |
| 800 | } |
| 801 | return true |
| 802 | } |
| 803 | |
| 804 | // validate checks the referential integrity |
| 805 | // ensures len(keys) == len(containers), recurses and checks each container type |