Commit fc0c082

mokha <mokha@cisco.com>
2019-03-15 00:49:40
use fetch to return the default.
1 parent 35dc9fd
Changed files (1)
lib
lib/minbox/client.rb
@@ -102,6 +102,7 @@ module Minbox
       /^RSET/i => Noop.new,
       /^STARTTLS/i => StartTls.new,
     )
+    UNSUPPORTED = Unsupported.new
     attr_reader :server, :socket, :logger
 
     def initialize(server, socket, logger)
@@ -113,7 +114,7 @@ module Minbox
     def handle(&block)
       write "220 #{server.host} ESMTP"
       while connected? && (line = read)
-        command = COMMANDS[line] || Unsupported.new
+        command = COMMANDS.fetch(line, UNSUPPORTED)
         command.run(self, line, &block)
       end
       close