Skip to content

Flowc java long strings#1184

Open
dmitry-vlasov wants to merge 2 commits into
masterfrom
flowc_java_long_strings
Open

Flowc java long strings#1184
dmitry-vlasov wants to merge 2 commits into
masterfrom
flowc_java_long_strings

Conversation

@dmitry-vlasov
Copy link
Copy Markdown
Contributor

No description provided.

@dmitry-vlasov dmitry-vlasov requested a review from Eugeny48 April 12, 2023 13:53
Comment thread lib/string_utils.flow
Comment on lines +452 to +453
n0 = s_len / len;
n = if (s_len == (n0 * len)) n0 else n0 + 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
n0 = s_len / len;
n = if (s_len == (n0 * len)) n0 else n0 + 1;
n = (s_len - 1) / len + 1;

// TODO: We use UTF-16, so to be sure about long strings is it enough 32000 as a safe border? ...
long_string_ind = length(^(ctx.func.gctx.longStrings));
(ctx.func.gctx).longStrings := concat(^(ctx.func.gctx.longStrings), [s]);
result("LongStrings.longString" + i2s(long_string_ind) + "()", "String");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create this long string only once? Maybe rework function-member into a field?

@Eugeny48
Copy link
Copy Markdown
Contributor

Can we move these long strings from code to a resource file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants