<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,23 +1,16 @@
 module ActionController
   module Routing
     class RouteBuilder #:nodoc:
-      attr_accessor :separators, :optional_separators
+      attr_reader :separators, :optional_separators
+      attr_reader :separator_regexp, :nonseparator_regexp, :interval_regexp
 
       def initialize
-        self.separators = Routing::SEPARATORS
-        self.optional_separators = %w( / )
-      end
-
-      def separator_pattern(inverted = false)
-        &quot;[#{'^' if inverted}#{Regexp.escape(separators.join)}]&quot;
-      end
-
-      def interval_regexp
-        Regexp.new &quot;(.*?)(#{separators.source}|$)&quot;
-      end
+        @separators = Routing::SEPARATORS
+        @optional_separators = %w( / )
 
-      def multiline_regexp?(expression)
-        expression.options &amp; Regexp::MULTILINE == Regexp::MULTILINE
+        @separator_regexp = /[#{Regexp.escape(separators.join)}]/
+        @nonseparator_regexp = /\A([^#{Regexp.escape(separators.join)}]+)/
+        @interval_regexp = /(.*?)(#{separator_regexp}|$)/
       end
 
       # Accepts a &quot;route path&quot; (a string defining a route), and returns the array
@@ -30,7 +23,7 @@ module ActionController
         rest, segments = path, []
 
         until rest.empty?
-          segment, rest = segment_for rest
+          segment, rest = segment_for(rest)
           segments &lt;&lt; segment
         end
         segments
@@ -39,20 +32,20 @@ module ActionController
       # A factory method that returns a new segment instance appropriate for the
       # format of the given string.
       def segment_for(string)
-        segment = case string
-          when /\A:(\w+)/
-            key = $1.to_sym
-            case key
-              when :controller then ControllerSegment.new(key)
-              else DynamicSegment.new key
-            end
-          when /\A\*(\w+)/ then PathSegment.new($1.to_sym, :optional =&gt; true)
-          when /\A\?(.*?)\?/
-            StaticSegment.new($1, :optional =&gt; true)
-          when /\A(#{separator_pattern(:inverted)}+)/ then StaticSegment.new($1)
-          when Regexp.new(separator_pattern) then
-            DividerSegment.new($&amp;, :optional =&gt; (optional_separators.include? $&amp;))
-        end
+        segment =
+          case string
+            when /\A:(\w+)/
+              key = $1.to_sym
+              key == :controller ? ControllerSegment.new(key) : DynamicSegment.new(key)
+            when /\A\*(\w+)/
+              PathSegment.new($1.to_sym, :optional =&gt; true)
+            when /\A\?(.*?)\?/
+              StaticSegment.new($1, :optional =&gt; true)
+            when nonseparator_regexp
+              StaticSegment.new($1)
+            when separator_regexp
+              DividerSegment.new($&amp;, :optional =&gt; optional_separators.include?($&amp;))
+          end
         [segment, $~.post_match]
       end
 
@@ -98,7 +91,7 @@ module ActionController
             if requirement.source =~ %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
               raise ArgumentError, &quot;Regexp anchor characters are not allowed in routing requirements: #{requirement.inspect}&quot;
             end
-            if multiline_regexp?(requirement)
+            if requirement.multiline?
               raise ArgumentError, &quot;Regexp multiline option not allowed in routing requirements: #{requirement.inspect}&quot;
             end
             segment.regexp = requirement</diff>
      <filename>actionpack/lib/action_controller/routing/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,10 @@ class Regexp #:nodoc:
     Regexp.new(&quot;|#{source}&quot;).match('').captures.length
   end
 
+  def multiline?
+    options &amp; MULTILINE == MULTILINE
+  end
+
   class &lt;&lt; self
     def optionalize(pattern)
       case unoptionalize(pattern)</diff>
      <filename>actionpack/lib/action_controller/routing/routing_ext.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>335a31524055c7dd79618ea79b3c18d827e25d3d</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/5db9f9b3ad47fadf0b3f12ada1c2ea7b9c15ded5</url>
  <id>5db9f9b3ad47fadf0b3f12ada1c2ea7b9c15ded5</id>
  <committed-date>2008-11-10T22:21:09-08:00</committed-date>
  <authored-date>2008-11-10T17:41:07-08:00</authored-date>
  <message>Pare down object creation during route building</message>
  <tree>62e09cf6ec6c70bd0319203862af82def8a5f094</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
