summaryrefslogtreecommitdiff
path: root/include/hashcomp.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-12-28 16:59:03 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-12-28 16:59:03 +0100
commit299f262a4fd1c0a508a5b6748761128a2c3efde9 (patch)
tree6ec11d59ecdd976ecf6636af22ebb49367da5fcf /include/hashcomp.h
parent03561f500eb8e82b2ddfa0489fb4ae03c2c9631b (diff)
Fix some whitespace issues
Diffstat (limited to 'include/hashcomp.h')
-rw-r--r--include/hashcomp.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index c99b5d646..87b2636fc 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -72,25 +72,25 @@ CoreExport extern unsigned const char rfc_case_sensitive_map[256];
template<typename T> const T& SearchAndReplace(T& text, const T& pattern, const T& replace)
{
- T replacement;
- if ((!pattern.empty()) && (!text.empty()))
- {
- for (std::string::size_type n = 0; n != text.length(); ++n)
- {
- if (text.length() >= pattern.length() && text.substr(n, pattern.length()) == pattern)
- {
- /* Found the pattern in the text, replace it, and advance */
- replacement.append(replace);
- n = n + pattern.length() - 1;
- }
- else
- {
- replacement += text[n];
- }
- }
- }
- text = replacement;
- return text;
+ T replacement;
+ if ((!pattern.empty()) && (!text.empty()))
+ {
+ for (std::string::size_type n = 0; n != text.length(); ++n)
+ {
+ if (text.length() >= pattern.length() && text.substr(n, pattern.length()) == pattern)
+ {
+ // Found the pattern in the text, replace it, and advance
+ replacement.append(replace);
+ n = n + pattern.length() - 1;
+ }
+ else
+ {
+ replacement += text[n];
+ }
+ }
+ }
+ text = replacement;
+ return text;
}
/** The irc namespace contains a number of helper classes.