From 4f8a5f2a78d05cc15e2fde4d4ccd0b5933c740b5 Mon Sep 17 00:00:00 2001 From: chhavikirtani2000 <55941961+chhavikirtani2000@users.noreply.github.com> Date: Sat, 28 Mar 2020 21:42:27 +0530 Subject: [PATCH] removed temp --- lib/parfait/word.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/parfait/word.rb b/lib/parfait/word.rb index 7f002412..60776549 100644 --- a/lib/parfait/word.rb +++ b/lib/parfait/word.rb @@ -193,16 +193,14 @@ module Parfait def start_with(other) return false if other.length > self.length s = other.length - temp = Word.new(other.length) i=0 while i<=s-1 - temp.set_char(i,self.get_char(i)) - if temp.compare(other) - return true + if other.get_char(i) != self.get_char(i) + return false end i=i+1 end - return false + return true end private def check_length