Pick up assert recommendation

This commit is contained in:
jpirnay
2026-03-07 10:20:11 +01:00
parent 861778d717
commit 520ae07ad5
+3
View File
@@ -1,6 +1,7 @@
#include "Hyphenator.h"
#include <algorithm>
#include <cassert>
#include <vector>
#include "HyphenationCommon.h"
@@ -85,6 +86,8 @@ void appendSegmentPatternBreaks(const std::vector<CodepointInfo>& cps, const Lan
}
for (const size_t idx : segIndexes) {
assert(idx > 0 && idx < segment.size());
if (idx == 0 || idx >= segment.size()) continue;
const size_t cpIdx = segStart + idx;
if (cpIdx < cps.size()) {
outBreaks.push_back({cps[cpIdx].byteOffset, true});