提交 07ddfaa0 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Assign variable only when needed in dateValueFromAbsoluteDay()

上级 1037cc21
...@@ -1305,7 +1305,7 @@ public class DateTimeUtils { ...@@ -1305,7 +1305,7 @@ public class DateTimeUtils {
*/ */
public static long dateValueFromAbsoluteDay(long absoluteDay) { public static long dateValueFromAbsoluteDay(long absoluteDay) {
long d = absoluteDay + 719_468; long d = absoluteDay + 719_468;
long y100 = 0, offset; long y100, offset;
if (d > 578_040) { if (d > 578_040) {
// Gregorian calendar // Gregorian calendar
long y400 = d / 146_097; long y400 = d / 146_097;
...@@ -1315,6 +1315,7 @@ public class DateTimeUtils { ...@@ -1315,6 +1315,7 @@ public class DateTimeUtils {
offset = y400 * 400 + y100 * 100; offset = y400 * 400 + y100 * 100;
} else { } else {
// Julian calendar // Julian calendar
y100 = 0;
d += 292_200_000_002L; d += 292_200_000_002L;
offset = -800_000_000; offset = -800_000_000;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论