From 9716b13861645e6e5d4589e7c56415328f68c976 Mon Sep 17 00:00:00 2001 From: "Abinoam P. Marques Jr" Date: Sun, 2 Jul 2017 01:25:17 -0300 Subject: Simplify conditional --- lib/highline/question_asker.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/highline/question_asker.rb b/lib/highline/question_asker.rb index 4c1ff5b..10a43ef 100644 --- a/lib/highline/question_asker.rb +++ b/lib/highline/question_asker.rb @@ -75,12 +75,11 @@ class HighLine if verify_match && (@highline.send(:unique_answers, answers).size > 1) explain_error(:mismatch) else - verify_match = false + break end - break unless verify_match end - question.verify_match ? @highline.send(:last_answer, answers) : answers + verify_match ? @highline.send(:last_answer, answers) : answers end # Gather multiple integer values based on {Question#gather} count -- cgit v1.2.1