File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -37,20 +37,18 @@ string minifyString(string jsonString, bool hasComments = false) @trusted
37
37
{
38
38
const matchFrontHit = match.front().hit();
39
39
40
- const leftContext = match.pre();
41
40
rightContext = match.post();
42
41
43
- const lastIndex = jsonString.length - rightContext.length;
44
-
45
- auto leftContextSubstr = leftContext[from .. $];
46
-
47
42
// update from for the next iteration
48
- from = lastIndex;
43
+ const prevFrom = from;
44
+ from = jsonString.length - rightContext.length; // lastIndex
49
45
50
46
const noCommentOrNotInComment = ! hasComments || (! in_multiline_comment && ! in_singleline_comment);
51
47
52
48
if (noCommentOrNotInComment)
53
49
{
50
+ auto leftContextSubstr = match.pre()[prevFrom .. $];
51
+
54
52
if (! in_string)
55
53
{
56
54
leftContextSubstr = leftContextSubstr.replaceAll(spaceOrBreakRegex, " " );
You can’t perform that action at this time.
0 commit comments