|
@@ -2,8 +2,8 @@ package irc
|
2
|
2
|
|
3
|
3
|
type WhoWasList struct {
|
4
|
4
|
buffer []*WhoWas
|
5
|
|
- start uint
|
6
|
|
- end uint
|
|
5
|
+ start int
|
|
6
|
+ end int
|
7
|
7
|
}
|
8
|
8
|
|
9
|
9
|
type WhoWas struct {
|
|
@@ -26,9 +26,9 @@ func (list *WhoWasList) Append(client *Client) {
|
26
|
26
|
hostname: client.hostname,
|
27
|
27
|
realname: client.realname,
|
28
|
28
|
}
|
29
|
|
- list.end = (list.end + 1) % uint(len(list.buffer))
|
|
29
|
+ list.end = (list.end + 1) % len(list.buffer)
|
30
|
30
|
if list.end == list.start {
|
31
|
|
- list.start = (list.end + 1) % uint(len(list.buffer))
|
|
31
|
+ list.start = (list.end + 1) % len(list.buffer)
|
32
|
32
|
}
|
33
|
33
|
}
|
34
|
34
|
|
|
@@ -46,10 +46,10 @@ func (list *WhoWasList) Find(nickname Name, limit int64) []*WhoWas {
|
46
|
46
|
return results
|
47
|
47
|
}
|
48
|
48
|
|
49
|
|
-func (list *WhoWasList) prev(index uint) uint {
|
|
49
|
+func (list *WhoWasList) prev(index int) int {
|
50
|
50
|
index -= 1
|
51
|
51
|
if index < 0 {
|
52
|
|
- index += uint(len(list.buffer))
|
|
52
|
+ index += len(list.buffer)
|
53
|
53
|
}
|
54
|
54
|
return index
|
55
|
55
|
}
|