mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit()
This commit is contained in:
parent
bad2c2154b
commit
f3938fdb83
|
@ -77,15 +77,6 @@ public:
|
|||
std::vector<T>::operator=(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
@ -555,7 +555,8 @@ void ClientNetworkContentSocketHandler::OnFailure()
|
|||
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) {
|
||||
|
|
|
@ -1272,7 +1272,8 @@ void CommitVehicleListOrderChanges()
|
|||
}
|
||||
|
||||
/* Clear out the queue */
|
||||
_list_order_changes.Reset();
|
||||
_list_order_changes.clear();
|
||||
_list_order_changes.shrink_to_fit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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[] = {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -693,7 +693,8 @@ static AutoreplaceMap _vehicles_to_autoreplace;
|
|||
|
||||
void InitializeVehicles()
|
||||
{
|
||||
_vehicles_to_autoreplace.Reset();
|
||||
_vehicles_to_autoreplace.clear();
|
||||
_vehicles_to_autoreplace.shrink_to_fit();
|
||||
ResetVehicleHash();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue