- for (i = m_source->startOffset(); i < openBrace; ++i)
- numBOMsBeforeOpenBrace += data[i] == byteOrderMark;
- for (; i < closeBrace; ++i)
- numBOMsBetweenBraces += data[i] == byteOrderMark;
+ for (i = m_source->startOffset(); i < openBrace; ++i) {
+ if (data[i] == byteOrderMark) {
+ openBrace++;
+ closeBrace++;
+ }
+ }
+ for (; i < closeBrace; ++i) {
+ if (data[i] == byteOrderMark)
+ closeBrace++;
+ }
+
+ ASSERT(openBrace < closeBrace);