Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyshipping/binpack_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ def allpermutations_helper(permuted, todo, maxcounter, callback, bin, bestpack,
else:
others = todo[1:]
thispackage = todo[0]
weight = thispackage.weight
for dimensions in set(permutations((thispackage[0], thispackage[1], thispackage[2]))):
thispackage = Package(dimensions, nosort=True)
thispackage.weight = weight

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just putting this in the above initialization instead?

thispackage = Package(dimensions, weight=weight, nosort=True)

if thispackage in bin:
counter = allpermutations_helper(permuted + [thispackage], others, maxcounter, callback,
bin, bestpack, counter)
Expand Down