From: Markus Jais Date: 2002-02-19T17:18:22+09:00 Subject: Re: hash question On Mon, 18 Feb 2002 23:42:11 +0100, Yohanes Santoso wrote: > Sean Russell writes: > >> Yohanes Santoso wrote: >> >> > I don't think there will be any improvement. Assuming that the syntax >> > hash[/^b/].each works, then each element still has to be visited for >> >> I'd expect it to be worse, more like O(2n) rather than O(n), because >> you're doing one itteration for the hash match, and another for the >> actual evaluation. >> >> v- 1 + v- 1 >> hash[/^b].each {|k,v| >> print k, " -> ", v, "\n" if k =~ ^b > ^^^^^^^^^^ > oops, I didn't see that. > I think the original poster left it there by mistake, and I was > half-blind. yes, you are rigth. I left it there by mistake. sorry for the confusion markus > > YS.