Skip to content

Commit

Permalink
Try to trim extra packets to make a good page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ali1234 committed Sep 12, 2011
1 parent 532e71c commit 96c9009
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pagesplit.py
Expand Up @@ -89,7 +89,8 @@ def bad_page(self):
self.packets = []

def check_page(self):
if len(self.packets) == MagHandler.pol:
if len(self.packets) >= MagHandler.pol:
self.packets = self.packets[:MagHandler.pol]
rows = [p.r for p in self.packets]
c = [a1 == b1 for a1,b1 in zip(rows,MagHandler.packet_order)].count(True)
if c == MagHandler.pol: # flawless subpage
Expand Down

0 comments on commit 96c9009

Please sign in to comment.