From 544167c5c3aec5993928634c084ae9dd8650be38 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 31 Mar 2015 19:18:49 +0000 Subject: favor more string literals for cold call sites Literal regexps cost over 450 bytes of memory per-site and unnecessary use of them costs memory in places where raw execution speed does not matter. Nowadays, we can rely on String#end_with? (introduced in 1.8.7) for improved readability, too. --- bin/unicorn | 2 +- bin/unicorn_rails | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/unicorn b/bin/unicorn index c272e43..3c5e5cb 100755 --- a/bin/unicorn +++ b/bin/unicorn @@ -29,7 +29,7 @@ op = OptionParser.new("", 24, ' ') do |opts| opts.on("-I", "--include PATH", "specify $LOAD_PATH (may be used more than once)") do |path| - $LOAD_PATH.unshift(*path.split(/:/)) + $LOAD_PATH.unshift(*path.split(':')) end opts.on("-r", "--require LIBRARY", diff --git a/bin/unicorn_rails b/bin/unicorn_rails index b080846..ea4f822 100755 --- a/bin/unicorn_rails +++ b/bin/unicorn_rails @@ -30,7 +30,7 @@ op = OptionParser.new("", 24, ' ') do |opts| opts.on("-I", "--include PATH", "specify $LOAD_PATH (may be used more than once)") do |path| - $LOAD_PATH.unshift(*path.split(/:/)) + $LOAD_PATH.unshift(*path.split(':')) end opts.on("-r", "--require LIBRARY", -- cgit v1.2.3-24-ge0c7