Skip to content

Commit 2b11749

Browse files
committed
Improve comments
1 parent ab9024e commit 2b11749

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/truffleruby/core/time/RubyDateFormatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public static boolean formatCanBeFast(Token[] compiledPattern) {
579579
return false;
580580
}
581581
break;
582-
case FORMAT_OUTPUT: // only %6N
582+
case FORMAT_OUTPUT: // only %6N (optimizing for Logger::Formatter default format)
583583
RubyTimeOutputFormatter formatter = (RubyTimeOutputFormatter) token.getData();
584584

585585
// Check for the attributes present in the default case
@@ -595,7 +595,7 @@ public static boolean formatCanBeFast(Token[] compiledPattern) {
595595
return false;
596596
}
597597
break;
598-
case FORMAT_NANOSEC: // only %6N
598+
case FORMAT_NANOSEC: // only %6N (optimizing for Logger::Formatter default format)
599599
if (i - 1 >= 0 && compiledPattern[i - 1].getFormat() == Format.FORMAT_OUTPUT) {
600600
break;
601601
} else {
@@ -665,10 +665,10 @@ public static Rope formatToRopeFast(Token[] compiledPattern, ZonedDateTime dt,
665665
// This fast-path only handles the '%6N' format, so output will always be 6 characters long.
666666
final int length = 6;
667667
final int padding = length - microSecondRope.characterLength();
668-
assert padding >= 0 : microSecondRope;
669668

670669
// `padding` is guaranteed to be >= 0 because `nano` can be at most 9 digits long before the
671670
// conversion to microseconds. The division further constrains the rope to be at most 6 digits long.
671+
assert padding >= 0 : microSecondRope;
672672
if (padding == 0) {
673673
appendRope = microSecondRope;
674674
} else {

0 commit comments

Comments
 (0)