Changeset - r24056:b8fb0b45669c
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 4 years ago 2020-01-06 00:41:00
j.g.rennison@gmail.com
Codechange: Use cached town name for town list window filtering
1 file changed with 1 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/town_gui.cpp
Show inline comments
 
@@ -686,8 +686,6 @@ private:
 
	void BuildSortTownList()
 
	{
 
		if (this->towns.NeedRebuild()) {
 
			char buf[MAX_LENGTH_TOWN_NAME_CHARS * MAX_CHAR_LENGTH];
 

	
 
			this->towns.clear();
 

	
 
			for (const Town *t : Town::Iterate()) {
 
@@ -696,11 +694,7 @@ private:
 
					continue;
 
				}
 
				this->string_filter.ResetState();
 

	
 
				SetDParam(0, t->index);
 
				GetString(buf, STR_TOWN_NAME, lastof(buf));
 

	
 
				this->string_filter.AddLine(buf);
 
				this->string_filter.AddLine(t->GetCachedName());
 
				if (this->string_filter.GetState()) this->towns.push_back(t);
 
			}
 

	
0 comments (0 inline, 0 general)