本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
348B

  1. package roaring
  2. type manyIterable interface {
  3. nextMany(hs uint32, buf []uint32) int
  4. }
  5. type manyIterator struct {
  6. slice []uint16
  7. loc int
  8. }
  9. func (si *manyIterator) nextMany(hs uint32, buf []uint32) int {
  10. n := 0
  11. l := si.loc
  12. s := si.slice
  13. for n < len(buf) && l < len(s) {
  14. buf[n] = uint32(s[l]) | hs
  15. l++
  16. n++
  17. }
  18. si.loc = l
  19. return n
  20. }
上海开阖软件有限公司 沪ICP备12045867号-1