Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
objeck committed Feb 26, 2024
1 parent 8c05ea5 commit da2dedd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/compiler/lib_src/lang.obs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ bundle System {
@param c character array
@return byte array
~#
function : I(c : Char[]) ~ Byte[] {
function : ToBytes(c : Char[]) ~ Byte[] {
UNICODE_TO_BYTES;
}

Expand Down Expand Up @@ -4109,11 +4109,10 @@ bundle System {
@return byte array
~#
method : public : ToByteArray() ~ Byte[] {
str := @buffer->ToString(); # Unicode conversion
out := Byte->New[str->Size()];
out := Byte->New[@buffer->Size()];

each(i : str) {
out[i] := str->Get(i);
out[i] := @buffer[i];
};

return out;
Expand Down Expand Up @@ -4371,11 +4370,11 @@ each(i : cities) {
@return byte array
~#
method : public : native : ToByteArray() ~ Byte[] {
str := @string->ToBytes(); # Unicode conversion
out := Byte->New[str->Size()];
bytes := @string->ToBytes(); # Unicode conversion
out := Byte->New[bytes->Size()];

each(i : str) {
out[i] := str->Get(i);
each(i : bytes) {
out[i] := bytes->Get(i);
};

return out;
Expand Down

0 comments on commit da2dedd

Please sign in to comment.