The other one, absolutely. `eval` is extremely slow. There seems to be a worrying misconception in this community that more lines of code = slower in all cases. This is very, very false. Often, the optimum solution will be one that requires a larger amount of code. True in all cases? No. But don't just assume that short code is better. If you're curious about a particular case, benchmark it! Plenty of tools out there for that--the SES Benchmarker (found in my sig, I believe?) will work, for one.
As for the other one, I haven't tested it, but I think that this should work:
def cooldown_bonus ary = [] if @note =~ /Cooldown Bonus = <(\d+[ ].*(?:\s*,\s*\d+[ ].*)*)>/i $1.split(", ").each do |info| info =~ /(\d+) (.*)/i ary << [$1.to_i, $2.downcase] # [value, stat] end end return aryendEdit for explanation: I personally prefer using `[]` to `Array.new`--no real performance difference or anything, just syntax, but it looks a little cleaner. You don't need the `to_s` for $2, since it's already a string. `map` was just returning an Enumerator there, which you weren't using--best to just go with `each`. You didn't need the counter--just append to the array, hence `<<`. Similarly, it's fine to just put both values together in an array rather than pushing them individually. I might also consider moving the Cooldown Bonus Regex to a constant or something to save the time used to build it, but that's negligble unless you're doing it a truly enormous number of times in a row, which I doubt is the case.