[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] xs: allow taking a string as input
From: |
Eric Wong |
Subject: |
[PATCH 1/3] xs: allow taking a string as input |
Date: |
Mon, 13 Apr 2015 01:04:22 +0000 |
This allows us to avoid unnecessary Array conversions in
call sites
---
lib/dtas/xs.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dtas/xs.rb b/lib/dtas/xs.rb
index 04ac252..7b3a0c2 100644
--- a/lib/dtas/xs.rb
+++ b/lib/dtas/xs.rb
@@ -9,6 +9,6 @@ require 'shellwords'
# again, filesystems can use any byte value in names except '\0'.
module DTAS::XS # :nodoc:
def xs(ary)
- Shellwords.join(ary.map(&:b))
+ Shellwords.join(Array(ary).map(&:b))
end
end
--
EW