Macaulay2 Engine
Loading...
Searching...
No Matches

◆ isPrefixOf()

bool WordTable::isPrefixOf ( Word word1,
Word word2 )
staticprivate

Definition at line 86 of file WordTable.cpp.

88{
89 if (word2.size() < word1.size()) return false;
90 bool match = true;
91 for (auto k = 0; k < word1.size(); ++k)
92 if (word1.begin()[k] != word2.begin()[k])
93 {
94 match = false;
95 break;
96 }
97 return match;
98}
const int * begin() const
Definition Word.hpp:72
int size() const
Definition Word.hpp:74

References Word::size().

Referenced by isPrefix().