Skip to content

Commit 6266efa

Browse files
author
kroening
committed
cleanup in irept::compare
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@1056 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 42cc4b6 commit 6266efa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/util/irep.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,10 @@ int irept::compare(const irept &i) const
569569
r=id().compare(i.id());
570570
if(r!=0) return r;
571571

572-
if(get_sub().size()<i.get_sub().size()) return -1;
573-
if(get_sub().size()>i.get_sub().size()) return 1;
572+
const subt::size_type size=get_sub().size(),
573+
i_size=i.get_sub().size();
574+
if(size<i_size) return -1;
575+
if(size>i_size) return 1;
574576

575577
{
576578
irept::subt::const_iterator it1, it2;
@@ -588,8 +590,10 @@ int irept::compare(const irept &i) const
588590
assert(it1==get_sub().end() && it2==i.get_sub().end());
589591
}
590592

591-
if(get_named_sub().size()<i.get_named_sub().size()) return -1;
592-
if(get_named_sub().size()>i.get_named_sub().size()) return 1;
593+
const named_subt::size_type n_size=get_named_sub().size(),
594+
i_n_size=i.get_named_sub().size();
595+
if(n_size<i_n_size) return -1;
596+
if(n_size>i_n_size) return 1;
593597

594598
{
595599
irept::named_subt::const_iterator it1, it2;

0 commit comments

Comments
 (0)