Refactor code that uses String#scan
to use StringScanner
to improve performance
#520
Labels
enhancement
Enhancement to existing code
StringScanner using a
while
oruntil
loop is rough 2x faster thanString#scan
with a block. We should refactor the remaining code that still usesString#scan
to useStringScanner
.lib/ronin/support/binary/unhexdump/parser.rb
(numbers = rest.scan(/ ( )|([^\s]+)/)
)lib/ronin/support/encoding/base16.rb
(data.scan(/../).each do |hex_char|
)lib/ronin/support/encoding/hex.rb
(data.scan(/../) do |hex|
)lib/ronin/support/encoding/sql.rb
(data.scan(/../) do |hex_char|
)The text was updated successfully, but these errors were encountered: