Skip to content

Commit f36d8e0

Browse files
committed
SwitchSymbolFormatter: avoid calling Std.string() on the same object in a loop
1 parent 6e92dc6 commit f36d8e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/feathers/formatters/SwitchSymbolFormatter.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ class SwitchSymbolFormatter {
102102

103103
var uStrIndx:Int = 0;
104104

105+
var sourceStr = Std.string(source);
105106
var n:Int = format.length;
106107
for (i in 0...n) {
107108
var letter:String = format.charAt(i);
108109
if (letter == numberSymbol) {
109-
numStr += Std.string(source).charAt(uStrIndx++);
110+
numStr += sourceStr.charAt(uStrIndx++);
110111
} else {
111112
numStr += format.charAt(i);
112113
}

0 commit comments

Comments
 (0)