Use replace instead of each for replacing handlers

This commit is contained in:
sdogruyol 2017-05-13 09:16:59 -07:00
parent 62946fd987
commit ce024ba748

View file

@ -62,7 +62,7 @@ module Kemal
def handlers=(handlers : Array(HTTP::Handler))
clear
handlers.each { |handler| HANDLERS << handler }
HANDLERS.replace(handlers)
end
def add_handler(handler : HTTP::Handler | HTTP::WebSocketHandler, position = Kemal.config.custom_handler_position)