From: Howard Chu Date: Wed, 7 Sep 2011 06:37:37 +0000 (-0700) Subject: Cleanup unused code X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~51^2~2 X-Git-Url: https://git.sur5r.net/?p=openldap;a=commitdiff_plain;h=976a15097385f7ba0af0379fc9fd712e4e048467 Cleanup unused code --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index b814169b71..6db8c1caa0 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -3171,22 +3171,12 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) MDB_ppage *top, *parent; MDB_node *ni; unsigned int i; -#if 0 - MDB_dpage *dp; - ID2 mid; - int dirty_root = 0; -#endif mc->mc_txn->mt_dbs[mc->mc_dbi].md_entries -= mc->mc_xcursor->mx_txn.mt_dbs[mc->mc_xcursor->mx_cursor.mc_dbi].md_entries; cursor_pop_page(&mc->mc_xcursor->mx_cursor); if (mc->mc_xcursor->mx_cursor.mc_snum) { -#if 0 - if (mc->mc_xcursor->mx_cursor.mc_stack[0].mp_page->mp_flags & P_DIRTY) { - dirty_root = 1; - } -#endif while (mc->mc_xcursor->mx_cursor.mc_snum > 1) { top = CURSOR_TOP(&mc->mc_xcursor->mx_cursor); parent = CURSOR_PARENT(&mc->mc_xcursor->mx_cursor); @@ -3197,40 +3187,16 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) pg = NODEPGNO(ni); if ((rc = mdb_get_page(mc->mc_txn, pg, &mp))) return rc; -#if 0 - if (mp->mp_flags & P_DIRTY) { - /* drop it */ - mid.mid = pg; - mdb_mid2l_delete(mc->mc_txn->mt_u.dirty_list, &mid); - dp = mid.mptr; - dp->h.md_parent = (MDB_page *)mc->mc_txn->mt_env->me_dpages; - mc->mc_txn->mt_env->me_dpages = dp; - } else -#endif - { - /* free it */ - mdb_midl_append(mc->mc_txn->mt_free_pgs, pg); - } + /* free it */ + mdb_midl_append(mc->mc_txn->mt_free_pgs, pg); } rc = mdb_sibling(&mc->mc_xcursor->mx_cursor, 1); if (rc) break; } } -#if 0 - if (dirty_root) { - /* drop it */ - mid.mid = mc->mc_xcursor->mx_txn.mt_dbs[mc->mc_xcursor->mx_cursor.mc_dbi].md_root; - mdb_mid2l_delete(mc->mc_txn->mt_u.dirty_list, &mid); - dp = mid.mptr; - dp->h.md_parent = (MDB_page *)mc->mc_txn->mt_env->me_dpages; - mc->mc_txn->mt_env->me_dpages = dp; - } else -#endif - { - /* free it */ - mdb_midl_append(mc->mc_txn->mt_free_pgs, - mc->mc_xcursor->mx_txn.mt_dbs[mc->mc_xcursor->mx_cursor.mc_dbi].md_root); - } + /* free it */ + mdb_midl_append(mc->mc_txn->mt_free_pgs, + mc->mc_xcursor->mx_txn.mt_dbs[mc->mc_xcursor->mx_cursor.mc_dbi].md_root); } }