Added README docs for account/binary and renamed UInt -> Uint etc.

This commit is contained in:
Jae Kwon
2014-12-22 17:38:16 -08:00
parent 61d1635085
commit 383335d93c
21 changed files with 324 additions and 137 deletions

View File

@ -6,15 +6,15 @@ import (
// Sort for []uint64
type UInt64Slice []uint64
type Uint64Slice []uint64
func (p UInt64Slice) Len() int { return len(p) }
func (p UInt64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p UInt64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p UInt64Slice) Sort() { sort.Sort(p) }
func (p Uint64Slice) Len() int { return len(p) }
func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p Uint64Slice) Sort() { sort.Sort(p) }
func SearchUInt64s(a []uint64, x uint64) int {
func SearchUint64s(a []uint64, x uint64) int {
return sort.Search(len(a), func(i int) bool { return a[i] >= x })
}
func (p UInt64Slice) Search(x uint64) int { return SearchUInt64s(p, x) }
func (p Uint64Slice) Search(x uint64) int { return SearchUint64s(p, x) }