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

◆ isPrefixOf()

bool WordWithDataTable::isPrefixOf ( WordWithData word1,
WordWithData word2 )
staticprivate

Definition at line 344 of file WordTable.cpp.

346{
347 if (word2.size() < word1.size()) return false;
348 bool match = true;
349 for (auto k = 0; k < word1.size(); ++k)
350 if (word1.begin()[k] != word2.begin()[k])
351 {
352 match = false;
353 break;
354 }
355 return match;
356}
size_t size() const
Definition Word.hpp:148
const int * begin() const
Definition Word.hpp:140

References WordWithData::begin(), and WordWithData::size().

Referenced by isPrefix().