Skip to content

Commit

Permalink
fix: fix build on Arm MacOS with no SIMD
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 7, 2024
1 parent fa9c328 commit e8fb706
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/native/lib.d
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private bool notSlashAndNoSpaceOrBreak(const ref string str) @safe
}

/** Removes spaces from the original string */
private string remove_spaces(string str) @trusted nothrow
private string remove_spaces(string str) @trusted
{
static if (supports_sse4_1())
{
Expand All @@ -140,8 +140,11 @@ private string remove_spaces(string str) @trusted nothrow
}
else
{
import std.regex : replaceAll;

const spaceOrBreakRegex = ctRegex!(`\s`);
str.replaceAll(spaceOrBreakRegex, "");
return str;
}
}

Expand All @@ -157,6 +160,8 @@ private bool hasNoSpace(const ref string str) @trusted
}
else
{
import std.regex : matchFirst;

const spaceOrBreakRegex = ctRegex!(`\s`);
return str.matchFirst(spaceOrBreakRegex).empty();
}
Expand All @@ -174,8 +179,8 @@ private bool hasNoSpace(const ref string str) @trusted
*/
string[] minifyStrings(in string[] jsonStrings, in bool hasComment = false) @trusted
{
import std.algorithm: map;
import std.array: array;
import std.algorithm : map;
import std.array : array;

return jsonStrings.map!(jsonString => minifyString(jsonString, hasComment)).array();
}
Expand Down

0 comments on commit e8fb706

Please sign in to comment.