mirror of
https://github.com/mattrberry/crab.git
synced 2024-12-25 09:58:14 +01:00
save type doesn't need to check with a regular expression
This commit is contained in:
parent
19113be832
commit
c9aa7acfc6
1 changed files with 3 additions and 3 deletions
|
@ -7,8 +7,8 @@ module GBA
|
|||
FLASH512
|
||||
FLASH1M
|
||||
|
||||
def regex : Regex # don't rely on the 3 digits after this string
|
||||
/#{self}_V/
|
||||
def match_str : String # don't rely on the 3 digits after this string
|
||||
"#{self}_V"
|
||||
end
|
||||
|
||||
def bytes : Int
|
||||
|
@ -67,7 +67,7 @@ module GBA
|
|||
|
||||
private def self.find_type(file : File) : Type?
|
||||
str = file.gets_to_end
|
||||
Type.each { |type| return type if type.regex.matches?(str) }
|
||||
Type.each { |type| return type if str.includes?(type.match_str) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue