Kaydet (Commit) 3b6091ca authored tarafından Noel Grandin's avatar Noel Grandin

document the swap-on-free idiom usage

Effective C++, item 17

Change-Id: I5c6f20c9631f1ca86b481a56ef08d578a7addbad
üst a51c4237
......@@ -44,7 +44,7 @@ class DispatchWatcherHashMap : public ::boost::unordered_map< OUString, sal_Int3
public:
inline void free()
{
DispatchWatcherHashMap().swap( *this );
DispatchWatcherHashMap().swap( *this ); // get rid of reserved capacity
}
};
......
......@@ -337,7 +337,7 @@ class SetNodeHash : public ::boost::unordered_map< OUString ,
inline void free()
{
SetNodeHash().swap( *this );
SetNodeHash().swap( *this ); // get rid of reserved capacity
lAddedItems.free ();
lChangedItems.free();
lRemovedItems.free();
......@@ -372,7 +372,7 @@ class PerformanceHash : public ::boost::unordered_map< OUString
inline void free()
{
PerformanceHash().swap( *this );
PerformanceHash().swap( *this ); // get rid of reserved capacity
}
// normaly a complete string must match our hash key values ...
......
......@@ -108,7 +108,7 @@ class OUStringList : public ::comphelper::SequenceAsVector< OUString >
// the only way to free used memory really!
void free()
{
OUStringList().swap( *this );
OUStringList().swap( *this );// get rid of reserved capacity
}
};
......@@ -135,7 +135,7 @@ class BaseHash : public ::boost::unordered_map< OUString ,
// the only way to free used memory really!
void free()
{
BaseHash().swap( *this );
BaseHash().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -63,7 +63,7 @@ namespace framework {
{
inline void free()
{
FactoryManagerMap().swap( *this );
FactoryManagerMap().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -80,7 +80,7 @@ private:
{
inline void free()
{
MenuControllerMap().swap( *this );
MenuControllerMap().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -116,7 +116,7 @@ class OReadImagesDocumentHandler : public ::cppu::WeakImplHelper1< ::com::sun::s
public:
inline void free()
{
ImageHashMap().swap( *this );
ImageHashMap().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -112,7 +112,7 @@ class FWE_DLLPUBLIC OReadStatusBarDocumentHandler :
public:
inline void free()
{
StatusBarHashMap().swap( *this );
StatusBarHashMap().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -117,7 +117,7 @@ class FWE_DLLPUBLIC OReadToolBoxDocumentHandler :
public:
inline void free()
{
ToolBoxHashMap().swap( *this );
ToolBoxHashMap().swap( *this );// get rid of reserved capacity
}
};
......
......@@ -229,7 +229,7 @@ private:
public:
inline void free()
{
UrlToDispatchMap().swap( *this );
UrlToDispatchMap().swap( *this );// get rid of reserved capacity
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment