more optimizations

GSoC/Meterpreter_Web_Console
Brent Cook 2018-04-30 18:25:25 -05:00
parent 89ab409a1a
commit 1214f4d6c9
1 changed files with 12 additions and 12 deletions

View File

@ -40,20 +40,20 @@ module ExtTime
fields = str.split
secs = 0
fields.each_with_index { |f, idx|
fields.each_with_index do |f, idx|
case f
when /^year/
secs += 31536000 * fields[idx-1].to_i
when /^day/
secs += 86400 * fields[idx-1].to_i
when /^hour/
secs += 3600 * fields[idx-1].to_i
when /^min/
secs += 60 * fields[idx-1].to_i
when /^sec/
secs += 1 * fields[idx-1].to_i
when 'year', 'years'
secs += 31536000 * fields[idx - 1].to_i
when 'day', 'days'
secs += 86400 * fields[idx - 1].to_i
when 'hour', 'hours'
secs += 3600 * fields[idx - 1].to_i
when 'min', 'mins'
secs += 60 * fields[idx - 1].to_i
when 'sec', 'secs'
secs += 1 * fields[idx - 1].to_i
end
}
end
secs
end