Skip to content

Commit c5d1843

Browse files
committed
Token[] compilePattern
1 parent 1e7bcf8 commit c5d1843

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private static void addToPattern(List<Token> compiledPattern, String str) {
264264
}
265265

266266
@TruffleBoundary
267-
public static List<Token> compilePattern(Rope pattern, boolean dateLibrary, RubyContext context, Node currentNode) {
267+
public static Token[] compilePattern(Rope pattern, boolean dateLibrary, RubyContext context, Node currentNode) {
268268
List<Token> compiledPattern = new LinkedList<>();
269269

270270
Encoding enc = pattern.getEncoding();
@@ -352,7 +352,7 @@ public static List<Token> compilePattern(Rope pattern, boolean dateLibrary, Ruby
352352
}
353353
}
354354

355-
return compiledPattern;
355+
return compiledPattern.toArray(RubyDateFormatter.EMPTY_TOKEN_ARRAY);
356356
}
357357

358358
enum FieldType {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,8 @@ protected RubyString timeStrftime(VirtualFrame frame, RubyTime time, Object form
444444
CodeRange.CR_UNKNOWN);
445445
}
446446

447-
@TruffleBoundary
448447
protected Token[] compilePattern(Rope format) {
449-
final List<Token> tokens = RubyDateFormatter.compilePattern(format, false, getContext(), this);
450-
return tokens.toArray(RubyDateFormatter.EMPTY_TOKEN_ARRAY);
448+
return RubyDateFormatter.compilePattern(format, false, getContext(), this);
451449
}
452450

453451
// Optimised for the default Logger::Formatter time format: "%Y-%m-%dT%H:%M:%S.%6N "

0 commit comments

Comments
 (0)