summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-07-24 14:38:56 +0100
committerPeter Powell <petpow@saberuk.com>2017-07-24 14:44:11 +0100
commitd2b5c7d1fcda74a72c93937cc58b5b7ff80e2a0a (patch)
treece6fa919741a92156fe5ce5787452dc7c05b7143
parentb4c5a118dbea3403e073998eeb397316755b074a (diff)
Add DEFAULT_LIST_SIZE for the default list mode size.
-rw-r--r--include/listmode.h3
-rw-r--r--src/listmode.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/include/listmode.h b/include/listmode.h
index 94af1d524..96a13a519 100644
--- a/include/listmode.h
+++ b/include/listmode.h
@@ -63,6 +63,9 @@ class CoreExport ListModeBase : public ModeHandler
*/
typedef std::vector<ListLimit> limitlist;
+ /** The default maximum list size. */
+ static const unsigned int DEFAULT_LIST_SIZE = 64;
+
/** Finds the limit of modes that can be placed on the given channel name according to the config
* @param channame The channel name to find the limit for
* @return The maximum number of modes of this type that we allow to be set on the given channel name
diff --git a/src/listmode.cpp b/src/listmode.cpp
index cd034688c..b416d4a69 100644
--- a/src/listmode.cpp
+++ b/src/listmode.cpp
@@ -77,7 +77,7 @@ void ListModeBase::DoRehash()
// Add the default entry. This is inserted last so if the user specifies a
// wildcard record in the config it will take precedence over this entry.
- chanlimits.push_back(ListLimit("*", 64));
+ chanlimits.push_back(ListLimit("*", DEFAULT_LIST_SIZE));
// Most of the time our settings are unchanged, so we can avoid iterating the chanlist
if (oldlimits == chanlimits)
@@ -102,7 +102,7 @@ unsigned int ListModeBase::FindLimit(const std::string& channame)
return it->limit;
}
}
- return 64;
+ return DEFAULT_LIST_SIZE;
}
unsigned int ListModeBase::GetLimitInternal(const std::string& channame, ChanData* cd)