コード例 #1
0
ファイル: connection.go プロジェクト: ymonk/torrent
func (c *connection) lastHelpful() time.Time {
	lasts := []time.Time{c.lastUsefulChunkReceived}
	if c.t.seeding() {
		lasts = append(lasts, c.lastChunkSent)
	}
	return missinggo.Max(time.Time.Before, slices.ToEmptyInterface(lasts)...).(time.Time)
}
コード例 #2
0
ファイル: iterator.go プロジェクト: skycoin/skycoin
func StringIterator(a string) Iterator {
	return SliceIterator(slices.ToEmptyInterface(a))
}