Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hey-kong committed Jun 28, 2022
1 parent d49f3c4 commit b6f70a7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
6 changes: 0 additions & 6 deletions dbms/src/Common/MyDuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,4 @@ String MyDuration::toString() const
auto frac_str = fmt::format("{:06}", microsecond);
return fmt::format(fmt_str, sign > 0 ? "" : "-", hour, minute, second, frac_str);
}

UInt64 calcSeconds(Int32 hour, Int32 minute, Int32 second)
{
return hour * 3600 + minute * 60 + second;
}

} // namespace DB
4 changes: 0 additions & 4 deletions dbms/src/Common/MyDuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,4 @@ class MyDuration

String toString() const;
};

// returns seconds since '00:00:00'
UInt64 calcSeconds(Int32 hour, Int32 minute, Int32 second);

} // namespace DB
2 changes: 1 addition & 1 deletion dbms/src/Functions/FunctionsDuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct TiDBTimeToSecTransformerImpl
{
sign = -1;
}
return sign * calcSeconds(val.hours(), val.minutes(), val.seconds());
return sign * (val.hours() * 3600 + val.minutes() * 60 + val.seconds());
}
};

Expand Down

0 comments on commit b6f70a7

Please sign in to comment.