From 845e6ff45a704d1cb0495a31c05f5cb190252a43 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 7 Oct 2007 09:15:26 +0000 Subject: String#to_xs uses the fast_xs extension if available for Builder speedup. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/string/xchar.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 activesupport/lib/active_support/core_ext/string/xchar.rb (limited to 'activesupport/lib/active_support/core_ext/string') diff --git a/activesupport/lib/active_support/core_ext/string/xchar.rb b/activesupport/lib/active_support/core_ext/string/xchar.rb new file mode 100644 index 0000000000..d6aa4aa036 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/string/xchar.rb @@ -0,0 +1,10 @@ +begin + require 'fast_xs' + + class String + alias_method :original_xs, :to_xs if method_defined?(:to_xs) + alias_method :to_xs, :fast_xs + end +rescue LoadError + # fast_xs extension unavailable. +end -- cgit v1.2.3