Ram Watch/Ram Search - small speed optimization to the QueryItemText functions

This commit is contained in:
andres.delikat 2011-08-27 13:20:02 +00:00
parent 18a6b21deb
commit c7e8e7ece1
2 changed files with 6 additions and 3 deletions

View File

@ -44,7 +44,7 @@ namespace BizHawk.MultiClient
int defaultPrevWidth;
int defaultChangesWidth;
string currentSearchFile = "";
string addressFormatStr = "{0:X4} ";
bool sortReverse;
string sortedCol;
@ -184,6 +184,7 @@ namespace BizHawk.MultiClient
}
SetPlatformAndMemoryDomainLabel();
StartNewSearch();
addressFormatStr = "X" + GetNumDigits(Domain.Size - 1).ToString();
}
private void SetTotal()
@ -563,7 +564,7 @@ namespace BizHawk.MultiClient
text = "";
if (column == 0)
{
text = searchList[index].address.ToString("X" + GetNumDigits(Domain.Size - 1).ToString());
text = searchList[index].address.ToString(addressFormatStr);
}
if (column == 1)
{

View File

@ -34,6 +34,7 @@ namespace BizHawk.MultiClient
string currentWatchFile = "";
bool changes = false;
List<ToolStripMenuItem> domainMenuItems = new List<ToolStripMenuItem>();
string addressFormatStr = "{0:X4} ";
string sortedCol;
bool sortReverse;
@ -168,7 +169,7 @@ namespace BizHawk.MultiClient
if (watchList[index].type == atype.SEPARATOR)
text = "";
else
text = String.Format("{0:X" + GetNumDigits((Domain.Size - 1)).ToString() + "}", watchList[index].address);
text = watchList[index].address.ToString(addressFormatStr);
}
if (column == 1) //Value
{
@ -1321,6 +1322,7 @@ namespace BizHawk.MultiClient
{
Domain = Global.Emulator.MemoryDomains[pos];
}
addressFormatStr = "X" + GetNumDigits(Domain.Size - 1).ToString();
SetPlatformAndMemoryDomainLabel();
Update();
}