From faa295489370ed3e99f26171ca487a938616c3d2 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 20 Dec 2022 12:45:35 +0100 Subject: [PATCH] simpliy sendRow and sendColumn calls Signed-off-by: Csaba Kiraly --- DAS/validator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DAS/validator.py b/DAS/validator.py index df64afe..00b4610 100644 --- a/DAS/validator.py +++ b/DAS/validator.py @@ -74,9 +74,9 @@ class Validator: self.block.data[i] = 0 #broadcasted.print() for id in range(self.blockSize): - self.sendColumn(id, id) + self.sendColumn(id) for id in range(self.blockSize): - self.sendRow(id, id) + self.sendRow(id) def getColumn(self, index): return self.block.getColumn(index) @@ -106,14 +106,14 @@ class Validator: self.block.merge(self.receivedBlock) - def sendColumn(self, c, columnID): + def sendColumn(self, columnID): line = self.getColumn(columnID) if line.any(): self.logger.debug("col %d -> %s", columnID, self.columnNeighbors[columnID] , extra=self.format) for n in self.columnNeighbors[columnID]: n.receiveColumn(columnID, line) - def sendRow(self, r, rowID): + def sendRow(self, rowID): line = self.getRow(rowID) if line.any(): self.logger.debug("row %d -> %s", rowID, self.rowNeighbors[rowID], extra=self.format) @@ -125,16 +125,16 @@ class Validator: self.logger.error("I am a block proposer", extra=self.format) else: self.logger.debug("Sending restored rows...", extra=self.format) - for r in range(len(self.rowIDs)): - self.sendRow(r, self.rowIDs[r]) + for r in self.rowIDs: + self.sendRow(r) def sendColumns(self): if self.proposer == 1: self.logger.error("I am a block proposer", extra=self.format) else: self.logger.debug("Sending restored columns...", extra=self.format) - for c in range(len(self.columnIDs)): - self.sendColumn(c, self.columnIDs[c]) + for c in self.columnIDs: + self.sendColumn(c) def logRows(self): if self.logger.isEnabledFor(logging.DEBUG):