Pick up assert recommendation
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "Hyphenator.h"
|
#include "Hyphenator.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cassert>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "HyphenationCommon.h"
|
#include "HyphenationCommon.h"
|
||||||
@@ -85,6 +86,8 @@ void appendSegmentPatternBreaks(const std::vector<CodepointInfo>& cps, const Lan
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const size_t idx : segIndexes) {
|
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;
|
const size_t cpIdx = segStart + idx;
|
||||||
if (cpIdx < cps.size()) {
|
if (cpIdx < cps.size()) {
|
||||||
outBreaks.push_back({cps[cpIdx].byteOffset, true});
|
outBreaks.push_back({cps[cpIdx].byteOffset, true});
|
||||||
|
|||||||
Reference in New Issue
Block a user