github.com/decred/dcrlnd@v0.7.6/kvdb/test.go (about)

     1  package kvdb
     2  
     3  type KV struct {
     4  	key string
     5  	val string
     6  }
     7  
     8  func reverseKVs(a []KV) []KV {
     9  	for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
    10  		a[i], a[j] = a[j], a[i]
    11  	}
    12  
    13  	return a
    14  }