diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 23:04:04 +0100 |
commit | c2efba6907fab934a04959b9bb644cf7141cc955 (patch) | |
tree | c047244f99870e44a7a5d7e733c2857434c03765 /src/T2DLL/T2NameList.cpp | |
parent | 1eb8da84d77d0c865623421069ec38bfc7b0d461 (diff) | |
download | t2win-c2efba6907fab934a04959b9bb644cf7141cc955.tar.gz t2win-c2efba6907fab934a04959b9bb644cf7141cc955.zip |
matched T2DLL as well as i can
Diffstat (limited to 'src/T2DLL/T2NameList.cpp')
-rw-r--r-- | src/T2DLL/T2NameList.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/T2DLL/T2NameList.cpp b/src/T2DLL/T2NameList.cpp index 44ee91f..8fda1d6 100644 --- a/src/T2DLL/T2NameList.cpp +++ b/src/T2DLL/T2NameList.cpp @@ -105,35 +105,35 @@ T2Name* T2NameList::Search(const T2People* people, BOOL isFavorite) const { T2Name* T2NameList::Search(const CString& str, BOOL isFavorite) const { LArrayIterator iterator(*this); - T2Name *result = NULL; - T2Name *name = NULL; + T2Name *theFoundName = NULL; + T2Name *theName = NULL; - while (iterator.Next(&name)) { - if (name->IsFavorite() == isFavorite && *name == str) { - result = name; + while (iterator.Next(&theName)) { + if (theName->IsFavorite() == isFavorite && *theName == str) { + theFoundName = theName; break; } } - return result; + return theFoundName; } T2Name* T2NameList::FullNameSearch(T2TowerDoc* towerDoc, const CString& str, BOOL isFavorite) const { LArrayIterator iterator(*this); - T2Name *result = NULL; - T2Name *name = NULL; + T2Name *theFoundName = NULL; + T2Name *theName = NULL; - while (iterator.Next(&name)) { + while (iterator.Next(&theName)) { CString fullName; - name->MakeFullName(towerDoc, fullName); - BOOL nameMatches = (fullName == str); - if (name->IsFavorite() == isFavorite && nameMatches) { - result = name; + theName->MakeFullName(towerDoc, fullName); + BOOL isMatch = (str == fullName); + if (theName->IsFavorite() == isFavorite && isMatch) { + theFoundName = theName; break; } } - return result; + return theFoundName; } void T2NameList::Read(T2Archive& archive) { @@ -151,8 +151,8 @@ void T2NameList::Write(T2Archive& archive) const { archive << count; LArrayIterator iterator(*this); - T2Name *name; + T2Name *theName; - while (iterator.Next(&name)) - name->Write(archive); + while (iterator.Next(&theName)) + theName->Write(archive); } |