Skip to content

Conversation

@Eliya-56
Copy link

No description provided.

Copy link
Owner

@podkolzzzin podkolzzzin left a comment

Choose a reason for hiding this comment

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

It seems to me to create for command using while command would be more elegant solution and will allow to get rid of code duplication

@Eliya-56
Copy link
Author

Eliya-56 commented Jun 21, 2022

It seems to me to create for command using while command would be more elegant solution and will allow to get rid of code duplication

@podkolzzzin

I made while command using for command. I think that this way more elegant than vice versa.
It is also possible to make for using while, of course. Do you think it is better?

new JumpCommand()
})
.ToArray();
var ifCommandsCount = new IfCommand(_condition, realBody.ToArray(), Array.Empty<ICommand>()).Compile().Count() - 3;
Copy link
Owner

Choose a reason for hiding this comment

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

It's quite complex logic and you are duplicating it.
Let's reuse code from WhileCommand

Copy link
Owner

@podkolzzzin podkolzzzin left a comment

Choose a reason for hiding this comment

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

Let's reuse code from a WhileCommand

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