Skip to content

libtime::Tm::to_utc() is slow even if already utc #18725

Closed
@seanmonstar

Description

@seanmonstar

Tm.to_utc() calls out to the runtime fn rust_timegm twice, once to convert to a Timespec, and a second time to convert the timespec to a new Tm with offset of 0. If a Tm is already UTC, this should skip both those calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions