[ARVADOS] updated: 7d838bbf3337b2600fecb93322e6466b9a690a42

git at public.curoverse.com git at public.curoverse.com
Wed Jun 10 02:27:41 EDT 2015


Summary of changes:
 services/api/app/models/collection.rb | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

       via  7d838bbf3337b2600fecb93322e6466b9a690a42 (commit)
      from  1cd7fd3867acabeb29196da4cf505a0eb703b287 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7d838bbf3337b2600fecb93322e6466b9a690a42
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jun 8 03:11:22 2015 -0400

    6203: Remove unused vars. Remove unnecessary newline manipulation.

diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 4b9d568..2b47968 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -218,9 +218,8 @@ class Collection < ArvadosModel
     new_lines = []
     manifest.each_line do |line|
       line.rstrip!
-      words = line.split(' ')
       new_words = []
-      words.each do |word|
+      line.split(' ').each do |word|
         if match = Keep::Locator::LOCATOR_REGEXP.match(word)
           new_words << yield(match)
         else
@@ -229,17 +228,16 @@ class Collection < ArvadosModel
       end
       new_lines << new_words.join(' ')
     end
-
-    manifest = new_lines.join("\n") + "\n"
+    new_lines.join("\n") + "\n"
   end
 
   def self.each_manifest_locator manifest
     # Given a manifest text and a block, yield the regexp match object
     # for each locator.
     manifest.each_line do |line|
-      line.rstrip!
-      words = line.split(' ')
-      words.each do |word|
+      # line will have a trailing newline, but the last token is never
+      # a locator, so it's harmless here.
+      line.each_line(' ') do |word|
         if match = Keep::Locator::LOCATOR_REGEXP.match(word)
           yield(match)
         end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list