Skip to content

Commit c83f28d

Browse files
committed
Renamed APIs: has*() -> contains*()
Signed-off-by: Jaehyun Kim <[email protected]>
1 parent a779b62 commit c83f28d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/dbSta/src/dbEditHierarchy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void dbEditHierarchy::hierarchicalConnect(dbITerm* source_pin,
472472
}
473473

474474
dbInst* load_inst = iterm->getInst();
475-
if (dest_mod_inst->hasDbInst(load_inst)) {
475+
if (dest_mod_inst->containsDbInst(load_inst)) {
476476
load_iterms.insert(iterm);
477477
}
478478
}

src/odb/include/odb/db.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8265,8 +8265,12 @@ class dbModInst : public dbObject
82658265
/// Returns new mod inst if the operations succeeds.
82668266
/// Old mod inst is deleted along with its child insts.
82678267
dbModInst* swapMaster(dbModule* module);
8268-
bool hasDbInst(dbInst* inst) const;
8269-
bool hasDbModInst(dbModInst* mod_inst) const;
8268+
8269+
// Recursive search a given dbInst through child mod insts
8270+
bool containsDbInst(dbInst* inst) const;
8271+
8272+
// Recursive search a given dbModInst through child mod insts
8273+
bool containsDbModInst(dbModInst* mod_inst) const;
82708274

82718275
static dbModInst* create(dbModule* parentModule,
82728276
dbModule* masterModule,

src/odb/src/db/dbModInst.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ dbModInst* dbModInst::swapMaster(dbModule* new_module)
691691
return new_mod_inst;
692692
}
693693

694-
bool dbModInst::hasDbInst(dbInst* inst) const
694+
bool dbModInst::containsDbInst(dbInst* inst) const
695695
{
696696
dbModule* master = getMaster();
697697
if (master == nullptr) {
@@ -707,15 +707,15 @@ bool dbModInst::hasDbInst(dbInst* inst) const
707707

708708
// Recursively check child dbModInsts
709709
for (dbModInst* child_mod_inst : master->getModInsts()) {
710-
if (child_mod_inst->hasDbInst(inst)) {
710+
if (child_mod_inst->containsDbInst(inst)) {
711711
return true;
712712
}
713713
}
714714

715715
return false;
716716
}
717717

718-
bool dbModInst::hasDbModInst(dbModInst* inst) const
718+
bool dbModInst::containsDbModInst(dbModInst* inst) const
719719
{
720720
dbModule* master = getMaster();
721721
if (master == nullptr) {
@@ -724,7 +724,7 @@ bool dbModInst::hasDbModInst(dbModInst* inst) const
724724

725725
// Recursively check child dbModInsts
726726
for (dbModInst* child_mod_inst : master->getModInsts()) {
727-
if (child_mod_inst == inst || child_mod_inst->hasDbModInst(inst)) {
727+
if (child_mod_inst == inst || child_mod_inst->containsDbModInst(inst)) {
728728
return true;
729729
}
730730
}

0 commit comments

Comments
 (0)