Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unnecessary brackets #118

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions event_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type EventLog []*Event
func (e *EventLog) Add(ev *Event) {
ev.ID = []byte(e.currentindex())
ev.timestamp = time.Now()
(*e) = append((*e), ev)
*e = append(*e, ev)
}

// Clear events from eventlog
Expand All @@ -26,7 +26,7 @@ func (e *EventLog) Clear() {

// Replay events to a subscriber
func (e *EventLog) Replay(s *Subscriber) {
for i := 0; i < len((*e)); i++ {
for i := 0; i < len(*e); i++ {
id, _ := strconv.Atoi(string((*e)[i].ID))
if id >= s.eventid {
s.connection <- (*e)[i]
Expand All @@ -35,5 +35,5 @@ func (e *EventLog) Replay(s *Subscriber) {
}

func (e *EventLog) currentindex() string {
return strconv.Itoa(len((*e)))
return strconv.Itoa(len(*e))
}