Skip to content

Commit 1dd9ed1

Browse files
committed
Inlining method's arguments
1 parent 3f3ca70 commit 1dd9ed1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatter.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ class Iso8601DateTimeFormatter(
5858
}
5959
}
6060

61-
private def instantToMicros(instant: Instant, secMul: Long, nanoDiv: Long): Long = {
62-
val sec = Math.multiplyExact(instant.getEpochSecond, secMul)
63-
val result = Math.addExact(sec, instant.getNano / nanoDiv)
61+
private def instantToMicros(instant: Instant): Long = {
62+
val sec = Math.multiplyExact(instant.getEpochSecond, DateTimeUtils.MICROS_PER_SECOND)
63+
val result = Math.addExact(sec, instant.getNano / DateTimeUtils.NANOS_PER_MICROS)
6464
result
6565
}
6666

67-
def parse(s: String): Long = {
68-
instantToMicros(toInstant(s), DateTimeUtils.MICROS_PER_SECOND, DateTimeUtils.NANOS_PER_MICROS)
69-
}
67+
def parse(s: String): Long = instantToMicros(toInstant(s))
7068

7169
def format(us: Long): String = {
7270
val secs = Math.floorDiv(us, DateTimeUtils.MICROS_PER_SECOND)

0 commit comments

Comments
 (0)