Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
code review feedback
  • Loading branch information
loverso authored and bemasher committed Jul 9, 2015
1 parent b9240f9 commit dbdbcae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var decimation = flag.Int("decimation", 1, "integer decimation factor, keep ever
var timeLimit = flag.Duration("duration", 0, "time to run for, 0 for infinite, ex. 1h5m10s")
var meterID UintMap
var meterType UintMap
var unique = flag.Bool("unique", false, "do not print duplicate values from each meter")
var unique = flag.Bool("unique", false, "do not print duplicate messages from each meter")

var encoder Encoder
var format = flag.String("format", "plain", "format to write log messages in: plain, csv, json, xml or gob")
Expand Down
2 changes: 1 addition & 1 deletion recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (rcvr *Receiver) Run() {
continue
}
if *unique {
if lastValue[uint(pkt.MeterID())] == pkt.MeterValue() {
if val, ok := lastValue[uint(pkt.MeterID())]; ok && val == pkt.MeterValue() {
continue
}
lastValue[uint(pkt.MeterID())] = pkt.MeterValue()
Expand Down

0 comments on commit dbdbcae

Please sign in to comment.