Skip to content

Commit

Permalink
python style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yingjieMiao committed Oct 9, 2014
1 parent 4b6e777 commit a8e74bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,9 @@ def take(self, num):
if len(items) == 0:
numPartsToTry = partsScanned * 4
else:
#the first paramter of max is >=1 whenever partsScanned >= 2
numPartsToTry = max(int(1.5 * num * partsScanned / len(items)) - partsScanned, 1)
numPartsToTry = min(numPartsToTry, partsScanned * 4)
# the first paramter of max is >=1 whenever partsScanned >= 2
numPartsToTry = int(1.5 * num * partsScanned / len(items)) - partsScanned
numPartsToTry = min(max(numPartsToTry, 1), partsScanned * 4)

left = num - len(items)

Expand Down

0 comments on commit a8e74bb

Please sign in to comment.