github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/util/packed/bulkOperation8.go (about)

     1  // This file has been automatically generated, DO NOT EDIT
     2  
     3  		package packed
     4  
     5  		// Efficient sequential read/write of packed integers.
     6  type BulkOperationPacked8 struct {
     7  	*BulkOperationPacked
     8  }
     9  
    10  func newBulkOperationPacked8() BulkOperation {
    11  	return &BulkOperationPacked8{newBulkOperationPacked(8)}
    12  }
    13  
    14  func (op *BulkOperationPacked8) decodeLongToInt(blocks []int64, values []int32, iterations int) {
    15  	blocksOffset, valuesOffset := 0, 0
    16  	for i := 0; i < iterations; i ++ {
    17  		block := blocks[blocksOffset]; blocksOffset++
    18  		for shift := uint(56); shift >= 0; shift -= 8 {
    19  			values[valuesOffset] = int32((int64(uint64(block) >> shift)) & 255); valuesOffset++
    20  		}
    21  	}
    22  }
    23  
    24  func (op *BulkOperationPacked8) decodeByteToInt(blocks []byte, values []int32, iterations int) {
    25  	blocksOffset, valuesOffset := 0, 0
    26  	for j := 0; j < iterations; j ++ {
    27  		values[valuesOffset] = int32(blocks[blocksOffset]); valuesOffset++; blocksOffset++
    28  	}
    29  }
    30  func (op *BulkOperationPacked8) decodeLongToLong(blocks []int64, values []int64, iterations int) {
    31  	blocksOffset, valuesOffset := 0, 0
    32  	for i := 0; i < iterations; i ++ {
    33  		block := blocks[blocksOffset]; blocksOffset++
    34  		for shift := uint(56); shift >= 0; shift -= 8 {
    35  			values[valuesOffset] = (int64(uint64(block) >> shift)) & 255; valuesOffset++
    36  		}
    37  	}
    38  }
    39  
    40  func (op *BulkOperationPacked8) decodeByteToLong(blocks []byte, values []int64, iterations int) {
    41  	blocksOffset, valuesOffset := 0, 0
    42  	for j := 0; j < iterations; j ++ {
    43  		values[valuesOffset] = int64(blocks[blocksOffset]); valuesOffset++; blocksOffset++
    44  	}
    45  }