Skip to content
Browse files

Simplified the instruction loading code

  • Loading branch information...
1 parent fd86b42 commit 3b731abb8ed59674727accfdf68086a9bbcdad1b @farcaller farcaller committed Apr 24, 2012
Showing with 2 additions and 13 deletions.
  1. +2 −13 lib/indis-arm/code_parser.rb
View
15 lib/indis-arm/code_parser.rb
@@ -92,19 +92,8 @@ def instruction_masks
end
def load_instructions
- masks = {}
-
- InstructionLoader.instance.load.each do |klass|
- m = klass.bits_mask
- a = masks[m]
- unless a
- a = []
- masks[m] = a
- end
-
- a << klass
- end
-
+ masks = Hash.new { |h,k| h[k] = Array.new }
+ InstructionLoader.instance.load.each { |klass| masks[klass.bits_mask] << klass }
masks
end
end

0 comments on commit 3b731ab

Please sign in to comment.
Something went wrong with that request. Please try again.