]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add DEFAULT_LIST_SIZE for the default list mode size.
authorPeter Powell <petpow@saberuk.com>
Mon, 24 Jul 2017 13:38:56 +0000 (14:38 +0100)
committerPeter Powell <petpow@saberuk.com>
Mon, 24 Jul 2017 13:44:11 +0000 (14:44 +0100)
include/listmode.h
src/listmode.cpp

index 94af1d524f366541fc5fd5a04b70a6e46bb8b8ae..96a13a519b654103e2233687f10763b970a32cf3 100644 (file)
@@ -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
index cd034688c8ec2b6be81b8ce47f7c929d17fd7cc3..b416d4a69e6c09dc23821c7255faadcbd7884426 100644 (file)
@@ -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)