Skip to content

Commit fdbd707

Browse files
committed
Remove unused function WildcardMatch
No longer necessary after implementing netmask-based matching. Also remove a longer-unused function `skipspaces`.
1 parent ee21912 commit fdbd707

File tree

3 files changed

+0
-57
lines changed

3 files changed

+0
-57
lines changed

src/test/util_tests.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,6 @@ BOOST_AUTO_TEST_CASE(util_GetArg)
165165
BOOST_CHECK_EQUAL(GetBoolArg("booltest4", false), true);
166166
}
167167

168-
BOOST_AUTO_TEST_CASE(util_WildcardMatch)
169-
{
170-
BOOST_CHECK(WildcardMatch("127.0.0.1", "*"));
171-
BOOST_CHECK(WildcardMatch("127.0.0.1", "127.*"));
172-
BOOST_CHECK(WildcardMatch("abcdef", "a?cde?"));
173-
BOOST_CHECK(!WildcardMatch("abcdef", "a?cde??"));
174-
BOOST_CHECK(WildcardMatch("abcdef", "a*f"));
175-
BOOST_CHECK(!WildcardMatch("abcdef", "a*x"));
176-
BOOST_CHECK(WildcardMatch("", "*"));
177-
}
178-
179168
BOOST_AUTO_TEST_CASE(util_FormatMoney)
180169
{
181170
BOOST_CHECK_EQUAL(FormatMoney(0, false), "0.00");

src/util.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -889,43 +889,6 @@ string DecodeBase32(const string& str)
889889
return string((const char*)&vchRet[0], vchRet.size());
890890
}
891891

892-
893-
bool WildcardMatch(const char* psz, const char* mask)
894-
{
895-
while (true)
896-
{
897-
switch (*mask)
898-
{
899-
case '\0':
900-
return (*psz == '\0');
901-
case '*':
902-
return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask));
903-
case '?':
904-
if (*psz == '\0')
905-
return false;
906-
break;
907-
default:
908-
if (*psz != *mask)
909-
return false;
910-
break;
911-
}
912-
psz++;
913-
mask++;
914-
}
915-
}
916-
917-
bool WildcardMatch(const string& str, const string& mask)
918-
{
919-
return WildcardMatch(str.c_str(), mask.c_str());
920-
}
921-
922-
923-
924-
925-
926-
927-
928-
929892
static std::string FormatException(std::exception* pex, const char* pszThread)
930893
{
931894
#ifdef WIN32

src/util.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ std::string DecodeBase32(const std::string& str);
182182
std::string EncodeBase32(const unsigned char* pch, size_t len);
183183
std::string EncodeBase32(const std::string& str);
184184
void ParseParameters(int argc, const char*const argv[]);
185-
bool WildcardMatch(const char* psz, const char* mask);
186-
bool WildcardMatch(const std::string& str, const std::string& mask);
187185
void FileCommit(FILE *fileout);
188186
bool TruncateFile(FILE *file, unsigned int length);
189187
int RaiseFileDescriptorLimit(int nMinFD);
@@ -348,13 +346,6 @@ inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
348346
return pszTime;
349347
}
350348

351-
template<typename T>
352-
void skipspaces(T& it)
353-
{
354-
while (isspace(*it))
355-
++it;
356-
}
357-
358349
inline bool IsSwitchChar(char c)
359350
{
360351
#ifdef WIN32

0 commit comments

Comments
 (0)