Open postmodern opened 4 months ago
StringScanner using a while or until loop is rough 2x faster than String#scan with a block. We should refactor the remaining code that still uses String#scan to use StringScanner.
while
until
String#scan
StringScanner
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|
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|
)