summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-03-07 02:48:44 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-03-07 02:48:44 +0000
commit068558f888446691ebbb3df2105948e0d50300a5 (patch)
tree5224e0fa3e627bc9018af9660198ef15b19c5487 /indra/newview
parentc4059553afa289f51f9966b4283b2a62b7103303 (diff)
merge release@58791 vc8@58828 -> release
Adds Dev Studio 2005 (VC8) Reviewed by Rob
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llurlwhitelist.cpp24
-rw-r--r--indra/newview/llurlwhitelist.h7
2 files changed, 12 insertions, 19 deletions
diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp
index 65f7229abf..b5c704f554 100644
--- a/indra/newview/llurlwhitelist.cpp
+++ b/indra/newview/llurlwhitelist.cpp
@@ -21,7 +21,7 @@ LLUrlWhiteList::LLUrlWhiteList () :
mLoaded ( false ),
mFilename ( "url_whitelist.ini" ),
mUrlList ( 0 ),
- mUrlListIter ( 0 )
+ mCurIndex ( 0 )
{
}
@@ -102,10 +102,10 @@ bool LLUrlWhiteList::save ()
if ( file.is_open () )
{
// for each entry we have
- for ( LLStringListIter iter = mUrlList.begin (); iter != mUrlList.end (); ++iter )
+ for ( string_list_t::iterator iter = mUrlList.begin (); iter != mUrlList.end (); ++iter )
{
file << ( *iter ) << std::endl;
- };
+ }
file.close ();
@@ -121,8 +121,7 @@ bool LLUrlWhiteList::clear ()
{
mUrlList.clear ();
- // invalidate iterator since we changed the contents
- mUrlListIter = mUrlList.end ();
+ mCurIndex = 0;
return true;
}
@@ -156,7 +155,7 @@ bool LLUrlWhiteList::addItem ( const LLString& itemIn, bool saveAfterAdd )
{
LLString item = url_cleanup(itemIn);
- mUrlList.insert ( mUrlList.end (), item );
+ mUrlList.push_back ( item );
// use this when all you want to do is call addItem ( ... ) where necessary
if ( saveAfterAdd )
@@ -172,11 +171,8 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
if ( mUrlList.size () == 0 )
return false;
- mUrlListIter = mUrlList.begin ();
-
- valueOut = * ( mUrlListIter );
-
- ++mUrlListIter;
+ mCurIndex = 0;
+ valueOut = mUrlList[mCurIndex++];
return true;
}
@@ -185,12 +181,10 @@ bool LLUrlWhiteList::getFirst ( LLString& valueOut )
//
bool LLUrlWhiteList::getNext ( LLString& valueOut )
{
- if ( mUrlListIter == mUrlList.end () )
+ if ( mCurIndex >= mUrlList.size () )
return false;
- valueOut = * ( mUrlListIter );
-
- ++mUrlListIter;
+ valueOut = mUrlList[mCurIndex++];
return true;
}
diff --git a/indra/newview/llurlwhitelist.h b/indra/newview/llurlwhitelist.h
index e0d1f64ddb..43233eca3b 100644
--- a/indra/newview/llurlwhitelist.h
+++ b/indra/newview/llurlwhitelist.h
@@ -36,13 +36,12 @@ class LLUrlWhiteList
LLUrlWhiteList ();
static LLUrlWhiteList* sInstance;
- typedef std::list < LLString > LLStringList;
- typedef std::list < LLString >::iterator LLStringListIter;
+ typedef std::vector < LLString > string_list_t ;
bool mLoaded;
const LLString mFilename;
- LLStringList mUrlList;
- LLStringListIter mUrlListIter;
+ string_list_t mUrlList;
+ U32 mCurIndex;
};
#endif // LL_LLURLWHITELIST_H