Skip to content

Commit

Permalink
Add DEFAULT_LIST_SIZE for the default list mode size.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed Jul 24, 2017
1 parent b4c5a11 commit d2b5c7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/listmode.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/listmode.cpp
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d2b5c7d

Please sign in to comment.