Skip to content

Only add non empty commands to history#147

Merged
eldano merged 2 commits intomasterfrom
dont_store_empty_expr
Sep 21, 2021
Merged

Only add non empty commands to history#147
eldano merged 2 commits intomasterfrom
dont_store_empty_expr

Conversation

@eldano
Copy link
Copy Markdown
Contributor

@eldano eldano commented Sep 21, 2021

No description provided.

Copy link
Copy Markdown
Contributor

@grzuy grzuy left a comment

Choose a reason for hiding this comment

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

Nice!


defp add_command_to_history("", history), do: history
defp add_command_to_history(command, []), do: [command]
defp add_command_to_history(command, history), do: [command | history]
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.

Is the second clause needed? Isn't it actually covered by the 3rd clause already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right. Fixed

@eldano eldano merged commit b2d90c2 into master Sep 21, 2021
@eldano eldano deleted the dont_store_empty_expr branch September 21, 2021 19:10
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