MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / GetKeyMaxLength

Function GetKeyMaxLength

src/TextDict.cpp:27–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using namespace opencc;
26
27static size_t GetKeyMaxLength(const LexiconPtr& lexicon) {
28 size_t maxLength = 0;
29 for (const auto& entry : *lexicon) {
30 size_t keyLength = entry->KeyLength();
31 maxLength = (std::max)(keyLength, maxLength);
32 }
33 return maxLength;
34}
35
36TextDict::TextDict(const LexiconPtr& _lexicon)
37 : maxLength(GetKeyMaxLength(_lexicon)), lexicon(_lexicon) {

Callers 1

TextDictMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected