From 5bef23d6e16a1921f6fec647cd23fbc62949b420 Mon Sep 17 00:00:00 2001 From: chhavikirtani2000 <55941961+chhavikirtani2000@users.noreply.github.com> Date: Sat, 28 Mar 2020 20:45:00 +0530 Subject: [PATCH] review comments incorporated --- lib/parfait/word.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/parfait/word.rb b/lib/parfait/word.rb index ecb4f5a6..dc929eb6 100644 --- a/lib/parfait/word.rb +++ b/lib/parfait/word.rb @@ -194,14 +194,12 @@ module Parfait end def start_with(other) return false if other.length > self.length - str=self.to_string - prefix=other.to_string - s = str.size() - temp="" + s = other.length + temp = Word.new(other.length) i=0 while i<=s-1 - temp=temp+str[i] - if temp==prefix + temp.set_char(i,self.get_char(i)) + if temp.compare(other) return true end i=i+1