Simplified a bit of code in JavaScript, TypeScript, Python.

This commit is contained in:
Project Nayuki
2018-11-01 18:00:02 +00:00
parent a24466089b
commit 08886d2a3e
3 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -870,8 +870,8 @@ class _ReedSolomonGenerator(object):
for b in data:
factor = b ^ result.pop(0)
result.append(0)
for i in range(len(result)):
result[i] ^= _ReedSolomonGenerator._multiply(self.coefficients[i], factor)
for (i, coef) in enumerate(self.coefficients):
result[i] ^= _ReedSolomonGenerator._multiply(coef, factor)
return result