review comments incorporated

This commit is contained in:
chhavikirtani2000 2020-03-28 20:45:00 +05:30 committed by Torsten Rüger
parent 2e3b614c92
commit 5bef23d6e1

View File

@ -194,14 +194,12 @@ module Parfait
end end
def start_with(other) def start_with(other)
return false if other.length > self.length return false if other.length > self.length
str=self.to_string s = other.length
prefix=other.to_string temp = Word.new(other.length)
s = str.size()
temp=""
i=0 i=0
while i<=s-1 while i<=s-1
temp=temp+str[i] temp.set_char(i,self.get_char(i))
if temp==prefix if temp.compare(other)
return true return true
end end
i=i+1 i=i+1