Skip to content

Commit

Permalink
Fix custom ranger implementation in example project
Browse files Browse the repository at this point in the history
  • Loading branch information
annismckenzie committed Aug 14, 2016
1 parent 069433d commit fdefbdb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ func (dt *doneTODOs) New(todos map[string]*tTODO) *doneTODOs {
// Range satisfies the jet.Ranger interface and only returns TODOs that are done,
// even when the list contains TODOs that are not done.
func (dt *doneTODOs) Range() (reflect.Value, reflect.Value, bool) {
//log.Printf("Range called. Current index is %v, keys are %+v, list is %+v", dt.i, dt.keys, dt.list)
for dt.i < dt.len {
key := dt.keys[dt.i]
dt.i++
if dt.list[key].Done {
return reflect.ValueOf(key), reflect.ValueOf(dt.list[key]), (dt.i < dt.len)
return reflect.ValueOf(key), reflect.ValueOf(dt.list[key]), false
}
}
return reflect.Value{}, reflect.Value{}, true
Expand Down

0 comments on commit fdefbdb

Please sign in to comment.