From a320a95b07e2b6f2e6bb63ece6470935f8841c75 Mon Sep 17 00:00:00 2001 From: Dmitry Krasnoukhov Date: Wed, 24 Sep 2014 18:11:55 +0300 Subject: [PATCH] Improve normalize_name performance --- lib/sax-machine/handlers/sax_abstract_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sax-machine/handlers/sax_abstract_handler.rb b/lib/sax-machine/handlers/sax_abstract_handler.rb index 9a6f3fe..345f6d4 100644 --- a/lib/sax-machine/handlers/sax_abstract_handler.rb +++ b/lib/sax-machine/handlers/sax_abstract_handler.rb @@ -167,7 +167,7 @@ def element_values_for(config) end def normalize_name(name) - name.gsub(/\-/, "_") + name.to_s.tr("-", "_") end def set_attributes_on(object, attributes)