From e774734fd697f6741cb8c52f249f2f2f7adb2fad Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Mon, 29 Jul 2019 23:13:54 +0200 Subject: Use string[i] instead of GetChar(string, i) where appropriate --- DTFormatN.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'DTFormatN.c') diff --git a/DTFormatN.c b/DTFormatN.c index 37f604e..1556265 100644 --- a/DTFormatN.c +++ b/DTFormatN.c @@ -20,8 +20,8 @@ global func FormatN(string format, array placeholders, array items) for(var i = 0; i < GetLength(format); ++i) { - var c = GetChar(format, i); - if(c == 37) // % + var c = format[i]; + if(c == "%") { if(inPlaceholder == 0) { @@ -29,7 +29,7 @@ global func FormatN(string format, array placeholders, array items) } else if(inPlaceholder == 1) { - if(c == 37 && GetLength(placeholderType) == 0) // % + if(GetLength(placeholderType) == 0) { ret ..= "%"; inPlaceholder = 0; @@ -59,15 +59,15 @@ global func FormatN(string format, array placeholders, array items) { if(inPlaceholder == 0) { - ret = Format("%s%c", ret, c); + ret ..= c; } else if(inPlaceholder == 1) { - placeholderType = Format("%s%c", placeholderType, c); + placeholderType ..= c; } else if(inPlaceholder == 2) { - placeholderPart = Format("%s%c", placeholderPart, c); + placeholderPart ..= c; } } } -- cgit v1.2.3-54-g00ecf