Changeset - r23522:1fb564b1efa6
[Not reviewed]
master
0 7 0
Henry Wilson - 6 years ago 2018-09-23 16:16:49
m3henry@googlemail.com
Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit()
7 files changed with 12 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/core/smallvec_type.hpp
Show inline comments
 
@@ -78,15 +78,6 @@ public:
 
	}
 

	
 
	/**
 
	 * Remove all items from the list and free allocated memory.
 
	 */
 
	inline void Reset()
 
	{
 
		std::vector<T>::clear();
 
		std::vector<T>::shrink_to_fit();
 
	}
 

	
 
	/**
 
	 * Append an item and return it.
 
	 * @param to_add the number of items to append
 
	 * @return pointer to newly allocated item
src/network/network_content.cpp
Show inline comments
 
@@ -555,7 +555,8 @@ void ClientNetworkContentSocketHandler::
 
	uint files, bytes;
 
	this->DownloadSelectedContent(files, bytes, true);
 

	
 
	this->http_response.Reset();
 
	this->http_response.clear();
 
	this->http_response.shrink_to_fit();
 
	this->http_response_index = -2;
 

	
 
	if (this->curFile != NULL) {
src/newgrf_engine.cpp
Show inline comments
 
@@ -1272,7 +1272,8 @@ void CommitVehicleListOrderChanges()
 
	}
 

	
 
	/* Clear out the queue */
 
	_list_order_changes.Reset();
 
	_list_order_changes.clear();
 
	_list_order_changes.shrink_to_fit();
 
}
 

	
 
/**
src/saveload/waypoint_sl.cpp
Show inline comments
 
@@ -146,7 +146,8 @@ void MoveWaypointsToBaseStations()
 
		UpdateWaypointOrder(&v->current_order);
 
	}
 

	
 
	_old_waypoints.Reset();
 
	_old_waypoints.clear();
 
	_old_waypoints.shrink_to_fit();
 
}
 

	
 
static const SaveLoad _old_waypoint_desc[] = {
src/stringfilter.cpp
Show inline comments
 
@@ -28,7 +28,8 @@ static const WChar STATE_QUOTE2 = '"';
 
 */
 
void StringFilter::SetFilterTerm(const char *str)
 
{
 
	this->word_index.Reset();
 
	this->word_index.clear();
 
	this->word_index.shrink_to_fit();
 
	this->word_matches = 0;
 
	free(this->filter_buffer);
 

	
src/texteff.cpp
Show inline comments
 
@@ -108,7 +108,8 @@ void MoveAllTextEffects(uint delta_ms)
 

	
 
void InitTextEffects()
 
{
 
	_text_effects.Reset();
 
	_text_effects.clear();
 
	_text_effects.shrink_to_fit();
 
}
 

	
 
void DrawTextEffects(DrawPixelInfo *dpi)
src/vehicle.cpp
Show inline comments
 
@@ -693,7 +693,8 @@ static AutoreplaceMap _vehicles_to_autor
 

	
 
void InitializeVehicles()
 
{
 
	_vehicles_to_autoreplace.Reset();
 
	_vehicles_to_autoreplace.clear();
 
	_vehicles_to_autoreplace.shrink_to_fit();
 
	ResetVehicleHash();
 
}
 

	
0 comments (0 inline, 0 general)