From 50f48509fd26f500e526e586dade6b2d7617bfdb Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 14 Nov 2018 11:47:46 +0100 Subject: [PATCH] Use compile-time StringLiteral#downcase instead of runtime String#downcase (#508) --- src/kemal/handler.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kemal/handler.cr b/src/kemal/handler.cr index 61ad12a..bb59238 100644 --- a/src/kemal/handler.cr +++ b/src/kemal/handler.cr @@ -11,7 +11,7 @@ module Kemal macro only(paths, method = "GET") class_name = {{@type.name}} - method_downcase = {{method}}.downcase + method_downcase = {{method.downcase}} class_name_method = "#{class_name}/#{method_downcase}" ({{paths}}).each do |path| @@only_routes_tree.add class_name_method + path, '/' + method_downcase + path @@ -20,7 +20,7 @@ module Kemal macro exclude(paths, method = "GET") class_name = {{@type.name}} - method_downcase = {{method}}.downcase + method_downcase = {{method.downcase}} class_name_method = "#{class_name}/#{method_downcase}" ({{paths}}).each do |path| @@exclude_routes_tree.add class_name_method + path, '/' + method_downcase + path