Skip to content

Commit

Permalink
Directly cast string to bytes when converting to GBytes from string
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Jan 27, 2021
1 parent f1badae commit bf4fe21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/asgen/utils.d
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ auto toStaticGBytes (ubyte[] data) @trusted

auto toStaticGBytes (const string data) @trusted
{
return toStaticGBytes (data.to!(ubyte[]));
return toStaticGBytes (cast(immutable(ubyte)[]) data.representation);
}

@trusted
Expand Down

0 comments on commit bf4fe21

Please sign in to comment.