Skip to content

Commit

Permalink
Extract a common expression into a variable/const.
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Apr 8, 2024
1 parent 1d09af4 commit ea4df34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fc-solve/site/wml/src/ts/web-fc-solve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ interface GameVariantPresetCheckRet {
verdict: boolean;
}

const _PTR_SIZE: number = 4;
const _read_from_file_str_ptr_size: number = 32;
const _arg_str_ptr_size: number = 128;

Expand Down Expand Up @@ -747,8 +748,8 @@ export class FC_Solve {
const _state_string_buffer_size: number = 500;
const _move_string_buffer_size: number = 200;
const _move_buffer_size: number = 64;
const _args_buffer_size: number = 4 * 2;
const _last_arg_ptr_buffer_size: number = 4;
const _args_buffer_size: number = _PTR_SIZE * 2;
const _last_arg_ptr_buffer_size: number = _PTR_SIZE;
const _total_buffer_size: number =
_state_string_buffer_size +
_move_string_buffer_size +
Expand Down Expand Up @@ -816,7 +817,7 @@ export class FC_Solve {
ptr_type,
);
that.module_wrapper.Module.setValue(
args_buf + 4,
args_buf + _PTR_SIZE,
arg_str_ptr,
ptr_type,
);
Expand Down

0 comments on commit ea4df34

Please sign in to comment.