Skip to content

Commit 812aa9b

Browse files
author
Julio Auto
committed
Reduce number of calls to to_s and downcase
1 parent e72d9bd commit 812aa9b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/core/db_manager/note.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ def report_note(opts)
7575
if (opts[:port])
7676
proto = nil
7777
sname = nil
78-
case opts[:proto].to_s.downcase # Catch incorrect usages
78+
proto_lower = opts[:proto].to_s.downcase # Catch incorrect usages
79+
case proto_lower
7980
when 'tcp','udp'
80-
proto = opts[:proto].to_s.downcase
81+
proto = proto_lower
8182
sname = opts[:sname] if opts[:sname]
8283
when 'dns','snmp','dhcp'
8384
proto = 'udp'

0 commit comments

Comments
 (0)