github.com/vc42/parquet-go@v0.0.0-20240320194221-1a9adb5f23f5/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  }