Skip to content

Commit

Permalink
Remove unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Sep 17, 2024
1 parent 9cc22b5 commit a75da60
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions binary/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ func (w *binaryEncoder) writeJID(jid types.JID) {
}

func (w *binaryEncoder) writeAttributes(attributes Attrs) {
if attributes == nil {
return
}

for key, val := range attributes {
if val == "" || val == nil {
continue
Expand All @@ -201,19 +197,14 @@ func (w *binaryEncoder) writeAttributes(attributes Attrs) {
}
}

func (w *binaryEncoder) countAttributes(attributes Attrs) int {
if attributes == nil {
return 0
}

var count = 0
func (w *binaryEncoder) countAttributes(attributes Attrs) (count int) {
for _, val := range attributes {
if val == "" || val == nil {
continue
}
count += 1
}
return count
return
}

func (w *binaryEncoder) writeListStart(listSize int) {
Expand Down

0 comments on commit a75da60

Please sign in to comment.