Merge branch 'master' into 3761-pull-list-worker
[arvados.git] / sdk / python / arvados / _ranges.py
index 6f22badc29fe595aaa20618d901ab69b7e9d8b40..947b35fe0f5ac5bad581a7dbaf4ab1e28cb33809 100644 (file)
@@ -32,7 +32,7 @@ def first_block(data_locators, range_start, range_size):
     block_end = block_start + block_size
 
     # perform a binary search for the first block
-    # assumes that all of the blocks are contigious, so range_start is guaranteed
+    # assumes that all of the blocks are contiguous, so range_start is guaranteed
     # to either fall into the range of a block or be outside the block range entirely
     while not (range_start >= block_start and range_start < block_end):
         if lo == i:
@@ -66,11 +66,12 @@ class LocatorAndRange(object):
         return "LocatorAndRange(%r, %r, %r, %r)" % (self.locator, self.block_size, self.segment_offset, self.segment_size)
 
 def locators_and_ranges(data_locators, range_start, range_size):
-    """Get blocks that are covered by the range and return list of LocatorAndRange
-    objects.
+    """Get blocks that are covered by a range.
+
+    Returns a list of LocatorAndRange objects.
 
     :data_locators:
-      list of Range objects, assumes that blocks are in order and contigous
+      list of Range objects, assumes that blocks are in order and contiguous
 
     :range_start:
       start of range
@@ -82,8 +83,6 @@ def locators_and_ranges(data_locators, range_start, range_size):
     if range_size == 0:
         return []
     resp = []
-    range_start = range_start
-    range_size = range_size
     range_end = range_start + range_size
 
     i = first_block(data_locators, range_start, range_size)
@@ -126,7 +125,7 @@ def replace_range(data_locators, new_range_start, new_range_size, new_locator, n
     data_locators will be updated in place
 
     :data_locators:
-      list of Range objects, assumes that segments are in order and contigous
+      list of Range objects, assumes that segments are in order and contiguous
 
     :new_range_start:
       start of range to replace in data_locators
@@ -144,8 +143,6 @@ def replace_range(data_locators, new_range_start, new_range_size, new_locator, n
     if new_range_size == 0:
         return
 
-    new_range_start = new_range_start
-    new_range_size = new_range_size
     new_range_end = new_range_start + new_range_size
 
     if len(data_locators) == 0: