From 7f198cab3b95de894f827b020145abf7011f3719 Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Tue, 1 Dec 2015 21:47:49 +0200 Subject: [PATCH] Remove unnecessary check --- src/kemal/handler.cr | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/kemal/handler.cr b/src/kemal/handler.cr index 274a9ad..81b265c 100644 --- a/src/kemal/handler.cr +++ b/src/kemal/handler.cr @@ -6,7 +6,6 @@ class Kemal::Handler < HTTP::Handler def initialize @routes = [] of Route - @match = false end def call(request) @@ -21,7 +20,7 @@ class Kemal::Handler < HTTP::Handler def process_request(request) @routes.each do |route| match = route.match?(request) - if @match = match + if match params = Kemal::ParamParser.new(route, request).parse context = Context.new(request, params) begin @@ -32,9 +31,8 @@ class Kemal::Handler < HTTP::Handler end end end - unless @match - return render_404 - end + # Render 404 unless a route matches + return render_404 nil end