From 0be64ffe2f4ff8824b3084362706ffbf456ea490 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 31 May 2014 18:00:23 -0700 Subject: style: eliminate equality tests with true and false Using '== true' in a boolean expression is totally redundant, and using '== false' is pretty verbose (and arguably less readable in most cases) compared to '!'. It's somewhat of a pet peeve, perhaps, but I had some time waiting for some tests to run and decided to clean these up. Unfortunately, SLICC appears not to have the '!' operator, so I had to leave the '== false' tests in the SLICC code. --- src/mem/slicc/ast/PeekStatementAST.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mem/slicc') diff --git a/src/mem/slicc/ast/PeekStatementAST.py b/src/mem/slicc/ast/PeekStatementAST.py index a9816bd3d..d267df26e 100644 --- a/src/mem/slicc/ast/PeekStatementAST.py +++ b/src/mem/slicc/ast/PeekStatementAST.py @@ -68,12 +68,11 @@ class PeekStatementAST(StatementAST): if self.pairs.has_key("block_on"): address_field = self.pairs['block_on'] code(''' - if ( (m_is_blocking == true) && - (m_block_map.count(in_msg_ptr->m_$address_field) == 1) ) { - if (m_block_map[in_msg_ptr->m_$address_field] != &$qcode) { + if (m_is_blocking && + (m_block_map.count(in_msg_ptr->m_$address_field) == 1) && + (m_block_map[in_msg_ptr->m_$address_field] != &$qcode)) { $qcode.delayHead(); continue; - } } ''') -- cgit v1.2.3