Skip to content

Commit

Permalink
Merge pull request #19 from loskutov/patch-2
Browse files Browse the repository at this point in the history
common.fc: slightly optimize store_text
  • Loading branch information
arseny30 authored Oct 25, 2022
2 parents 9b2845a + 5e0e18a commit cf60d3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions func/common.fc
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ _ load_text_ref(slice cs) inline {
}

builder store_text(builder b, slice text) inline {
int len = slice_bits(text);
throw_unless(err::invalid_length, mod(len, 8) == 0);
return b.store_uint(slice_bits(text) / 8, 8)
(int len, int rem) = slice_bits(text) /% 8;
throw_if(err::invalid_length, rem);
return b.store_uint(len, 8)
.store_slice(text);
}

Expand Down

0 comments on commit cf60d3b

Please sign in to comment.