From: Martin Hansen Date: 2010-08-30T16:58:02+09:00 Subject: Speed issues iterating over chars Hello all, This snip of code needs more speed. Ideas? What is the state of Ruby and Inline C? Cheers, Martin class Hash BASE_SOLEXA = 64 # Soft masks sequence residues where the corresponding quality score # is below a given cutoff. def mask!(cutoff) if self.has_key? :SEQ and self.has_key? :SCORES seq = self[:SEQ] scores = self[:SCORES] i = 0 scores.each_char do |score| seq[i] = seq[i].downcase if score.ord - BASE_SOLEXA <= cutoff i += 1 end self[:SEQ] = seq end self end end -- Posted via http://www.ruby-forum.com/.