diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2022-05-11 11:00:56 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-10 16:00:56 -0700 |
commit | 334828c9982b4e61c8b243c52129050104c29044 (patch) | |
tree | e114e071157638578371577809669d204fb4dbd5 | |
parent | 297880050290ad04ce5bfd65c87ff5431495dbe1 (diff) | |
download | rack-334828c9982b4e61c8b243c52129050104c29044.tar.gz |
Avoid potential Array glob/unglob operations in `Rack::Builder`. (#1858)
-rw-r--r-- | lib/rack/builder.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb index cccc47f2..b85eb8ed 100644 --- a/lib/rack/builder.rb +++ b/lib/rack/builder.rb @@ -111,7 +111,12 @@ module Rack # default application if +run+ is not called later. If a block # is given, it is evaluated in the context of the instance. def initialize(default_app = nil, &block) - @use, @map, @run, @warmup, @freeze_app = [], nil, default_app, nil, false + @use = [] + @map = nil + @run = default_app + @warmup = nil + @freeze_app = false + instance_eval(&block) if block_given? end |