MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Decode

Function Decode

pkg/util/duration/duration.go:401–406  ·  view source on GitHub ↗

Decode reverses the three integers returned from Encode and produces an equal Duration to the original.

(sortNanos int64, months int64, days int64)

Source from the content-addressed store, hash-verified

399// Decode reverses the three integers returned from Encode and produces an equal
400// Duration to the original.
401func Decode(sortNanos int64, months int64, days int64) (Duration, error) {
402 nanos := sortNanos - months*nanosInMonth - days*nanosInDay
403 // TODO(dan): Handle underflow, then document that DecodeBigInt can be used
404 // in underflow cases.
405 return Duration{Months: months, Days: days, nanos: nanos}, nil
406}
407
408// TODO(dan): Write DecodeBigInt.
409

Callers 2

DecodeDurationAscendingFunction · 0.92
DecodeDurationDescendingFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…