Skip to content

Commit

Permalink
Remove unnecessary conversions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed May 24, 2024
1 parent 53eef15 commit b1f2ff5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (f TimeFormat) Decode(v any) (time.Time, error) {
case float64:
return time.UnixMilli(int64(math.Floor(v))).UTC(), nil
case int64:
return time.UnixMilli(int64(v)).UTC(), nil
return time.UnixMilli(v).UTC(), nil
default:
return time.Time{}, util.TimeErr
}
Expand All @@ -200,7 +200,7 @@ func (f TimeFormat) Decode(v any) (time.Time, error) {
case float64:
return time.UnixMicro(int64(math.Floor(v))).UTC(), nil
case int64:
return time.UnixMicro(int64(v)).UTC(), nil
return time.UnixMicro(v).UTC(), nil
default:
return time.Time{}, util.TimeErr
}
Expand All @@ -217,7 +217,7 @@ func (f TimeFormat) Decode(v any) (time.Time, error) {
case float64:
return time.Unix(0, int64(math.Floor(v))).UTC(), nil
case int64:
return time.Unix(0, int64(v)).UTC(), nil
return time.Unix(0, v).UTC(), nil
default:
return time.Time{}, util.TimeErr
}
Expand Down
2 changes: 1 addition & 1 deletion vtab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ func (cur *seriesCursor) EOF() bool {
}

func (cur *seriesCursor) RowID() (int64, error) {
return int64(cur.value), nil
return cur.value, nil
}

0 comments on commit b1f2ff5

Please sign in to comment.