From b1f2ff55a09d4745de9883441cd0f89283ee08a9 Mon Sep 17 00:00:00 2001 From: Nuno Cruces <ncruces@users.noreply.github.com> Date: Thu, 23 May 2024 17:20:40 +0100 Subject: [PATCH] Remove unnecessary conversions. --- time.go | 6 +++--- vtab_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/time.go b/time.go index a14870ea..cd72f35d 100644 --- a/time.go +++ b/time.go @@ -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 } @@ -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 } @@ -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 } diff --git a/vtab_test.go b/vtab_test.go index 69c4a4b8..1686c23e 100644 --- a/vtab_test.go +++ b/vtab_test.go @@ -116,5 +116,5 @@ func (cur *seriesCursor) EOF() bool { } func (cur *seriesCursor) RowID() (int64, error) { - return int64(cur.value), nil + return cur.value, nil }