Skip to content

Commit

Permalink
Minor clean-up.
Browse files Browse the repository at this point in the history
Document previous commit.
Use set() instead of repeated tests of equality in the symbol table.
  • Loading branch information
tpircher-zz committed Feb 8, 2012
1 parent 6a33626 commit 91ee53c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2012-02-08 Thomas Pircher <tehpeh@gmx.net>

* crc_symtable.py:
Bad-looking C code generated; make sure the bit-by-bit(fast) code does not
contain two instructions on one line. Thanks to "intgr" for the fix.

* crc_symtable.py:
Some small code clean-up: use set() instead of repeated tests of equality.

2011-12-19 Thomas Pircher <tehpeh@gmx.net>

* crc_models.py:
Expand Down
4 changes: 2 additions & 2 deletions crc_symtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __getTerminal(self, id):
return self.__pretty_bool(False)

elif id == "simple_crc_update_def":
if self.opt.Algorithm == self.opt.Algo_Bit_by_Bit or self.opt.Algorithm == self.opt.Algo_Bit_by_Bit_Fast:
if self.opt.Algorithm in set([self.opt.Algo_Bit_by_Bit, self.opt.Algo_Bit_by_Bit_Fast]):
if self.opt.Width != None and self.opt.Poly != None and self.opt.ReflectIn != None:
return self.__pretty_bool(True)
elif self.opt.Algorithm == self.opt.Algo_Table_Driven:
Expand All @@ -178,7 +178,7 @@ def __getTerminal(self, id):
return self.__pretty_bool(False)

elif id == "inline_crc_finalize":
if (self.opt.Algorithm == self.opt.Algo_Bit_by_Bit_Fast or self.opt.Algorithm == self.opt.Algo_Table_Driven) and \
if self.opt.Algorithm in set([self.opt.Algo_Bit_by_Bit_Fast, self.opt.Algo_Table_Driven]) and \
(self.opt.Width != None and self.opt.ReflectIn != None and self.opt.ReflectOut != None and self.opt.XorOut != None):
return self.__pretty_bool(True)
else:
Expand Down

0 comments on commit 91ee53c

Please sign in to comment.