github.com/parquet-go/parquet-go@v0.21.1-0.20240501160520-b3c3a0c3ed6f/page_min.go (about)

     1  package parquet
     2  
     3  import (
     4  	"bytes"
     5  )
     6  
     7  func minFixedLenByteArray(data []byte, size int) (min []byte) {
     8  	if len(data) > 0 {
     9  		min = data[:size]
    10  
    11  		for i, j := size, 2*size; j <= len(data); {
    12  			item := data[i:j]
    13  
    14  			if bytes.Compare(item, min) < 0 {
    15  				min = item
    16  			}
    17  
    18  			i += size
    19  			j += size
    20  		}
    21  	}
    22  	return min
    23  }