From 9ed90380981970668c5f44abad7adc574ec05aad Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 15 Feb 2007 21:00:42 +0000 Subject: [PATCH] add insert_unverified --- panda/src/express/ordered_vector.I | 19 ++++++++++++++++++- panda/src/express/ordered_vector.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/panda/src/express/ordered_vector.I b/panda/src/express/ordered_vector.I index 62d6d84b2d..1c165399ba 100644 --- a/panda/src/express/ordered_vector.I +++ b/panda/src/express/ordered_vector.I @@ -337,7 +337,7 @@ insert_unique(const TYPENAME ordered_vector::VALUE_TYPE &key) { // the appropriate place. If there are already elements // sorting equivalent to the key in the vector, the new // value is inserted following them. - +// // The return value is the iterator referencing the new // element. //////////////////////////////////////////////////////////////////// @@ -353,6 +353,23 @@ insert_nonunique(const TYPENAME ordered_vector::VALUE_TYPE &key) { } +//////////////////////////////////////////////////////////////////// +// Function: ordered_vector::insert_unverified +// Access: Public +// Description: Inserts the indicated key into the ordered vector at +// the indicated place. The user is trusted to have +// already verified that this is the correct sorting +// position; no checks are made. +//////////////////////////////////////////////////////////////////// +template +INLINE TYPENAME ordered_vector::ITERATOR ordered_vector:: +insert_unverified(TYPENAME ordered_vector::ITERATOR position, + const TYPENAME ordered_vector::VALUE_TYPE &key) { + TAU_PROFILE("ordered_vector::insert_unverified(iterator, const value_type &)", " ", TAU_USER); + ITERATOR result = _vector.insert(position, key); + return result; +} + //////////////////////////////////////////////////////////////////// // Function: ordered_vector::erase, with iterator // Access: Public diff --git a/panda/src/express/ordered_vector.h b/panda/src/express/ordered_vector.h index d062a88031..de338ff981 100644 --- a/panda/src/express/ordered_vector.h +++ b/panda/src/express/ordered_vector.h @@ -192,6 +192,7 @@ public: ITERATOR insert_nonunique(ITERATOR position, const VALUE_TYPE &key); INLINE pair insert_unique(const VALUE_TYPE &key); INLINE ITERATOR insert_nonunique(const VALUE_TYPE &key); + INLINE ITERATOR insert_unverified(ITERATOR position, const VALUE_TYPE &key); // Erase operations. INLINE ITERATOR erase(ITERATOR position);