aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index df58aa9a7..4d8752e95 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -57,12 +57,11 @@ LineLayout::LineLayout(int maxLineLength_) :
highlightColumn(false),
containsCaret(false),
edgeColumn(0),
+ bracePreviousStyles{},
hotspot(0,0),
widthLine(wrapWidthInfinite),
lines(1),
wrapIndent(0) {
- bracePreviousStyles[0] = 0;
- bracePreviousStyles[1] = 0;
Resize(maxLineLength_);
}
@@ -318,7 +317,7 @@ LineLayout *LineLayoutCache::Retrieve(Sci::Line lineNumber, Sci::Line lineCaret,
}
allInvalidated = false;
Sci::Position pos = -1;
- LineLayout *ret = 0;
+ LineLayout *ret = nullptr;
if (level == llcCaret) {
pos = 0;
} else if (level == llcPage) {
@@ -408,12 +407,12 @@ const Representation *SpecialRepresentations::RepresentationFromCharacter(const
PLATFORM_ASSERT(len <= 4);
const unsigned char ucStart = charBytes[0];
if (!startByteHasReprs[ucStart])
- return 0;
+ return nullptr;
MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes, len));
if (it != mapReprs.end()) {
return &(it->second);
}
- return 0;
+ return nullptr;
}
bool SpecialRepresentations::Contains(const char *charBytes, size_t len) const {
@@ -432,7 +431,7 @@ void SpecialRepresentations::Clear() {
}
void BreakFinder::Insert(Sci::Position val) {
- int posInLine = static_cast<int>(val);
+ const int posInLine = static_cast<int>(val);
if (posInLine > nextBreak) {
const std::vector<int>::iterator it = std::lower_bound(selAndEdge.begin(), selAndEdge.end(), posInLine);
if (it == selAndEdge.end()) {
@@ -522,7 +521,7 @@ TextSegment BreakFinder::Next() {
if (nextBreak == prev) {
nextBreak += charWidth;
} else {
- repr = 0; // Optimize -> should remember repr
+ repr = nullptr; // Optimize -> should remember repr
}
if ((nextBreak - prev) < lengthStartSubdivision) {
return TextSegment(prev, nextBreak - prev, repr);