diff options
Diffstat (limited to 'spec/practical/bf_spec.cr')
| -rw-r--r-- | spec/practical/bf_spec.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/practical/bf_spec.cr b/spec/practical/bf_spec.cr index cd14c59..d1ad488 100644 --- a/spec/practical/bf_spec.cr +++ b/spec/practical/bf_spec.cr @@ -122,13 +122,13 @@ describe "brainfuck parser" do end shift_block = (Parser.token('<') | Parser.token('>')).some.map do |cs| - left_count = cs.count { |c| c == '<' } + left_count = cs.count(&.==('<')) right_count = cs.size - left_count {type: BFOpType::Shift, amount: right_count - left_count} end add_block = (Parser.token('+') | Parser.token('-')).some.map do |cs| - minus_count = cs.count { |c| c == '-' } + minus_count = cs.count(&.==('-')) plus_count = cs.size - minus_count {type: BFOpType::Add, amount: plus_count - minus_count} end |
