Skip to content

Commit

Permalink
Avoid redundant initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jan 15, 2022
1 parent 3750f79 commit 2f849a7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 0 additions & 2 deletions scintilla/src/Document.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3016,8 +3016,6 @@ class UTF8Iterator {

explicit UTF8Iterator(const Document *doc_ = nullptr, Sci::Position position_ = 0) noexcept :
doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0), buffered{} {
buffered[0] = 0;
buffered[1] = 0;
if (doc) {
ReadCharacter();
}
Expand Down
2 changes: 1 addition & 1 deletion scintilla/src/EditModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ using namespace Scintilla::Internal;
Caret::Caret() noexcept :
active(false), on(false), period(500) {}

EditModel::EditModel() : braces{} {
EditModel::EditModel() {
inOverstrike = false;
trackLineWidth = false;
xOffset = 0;
Expand Down
2 changes: 1 addition & 1 deletion scintilla/src/Partitioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Partitioning {
}

public:
explicit Partitioning(int growSize) : stepPartition(0), stepLength(0) {
explicit Partitioning(int growSize) {
Allocate(growSize);
}

Expand Down
6 changes: 3 additions & 3 deletions scintilla/src/PositionCache.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ XYPOSITION ScreenLine::TabPositionAfter(XYPOSITION xPosition) const noexcept {
return (std::floor((xPosition + TabWidthMinimumPixels()) / TabWidth()) + 1) * TabWidth();
}

LineLayoutCache::LineLayoutCache() :
LineLayoutCache::LineLayoutCache() noexcept:
lastCaretSlot(SIZE_MAX),
level(LineCache::None),
allInvalidated(false), styleClock(-1) {
Expand Down Expand Up @@ -876,7 +876,7 @@ TextSegment BreakFinder::Next() {

const int lengthSegment = nextBreak - prev;
if (lengthSegment < lengthStartSubdivision) {
return TextSegment(prev, lengthSegment, repr);
return {prev, lengthSegment, repr};
}
subBreak = prev;
}
Expand All @@ -893,7 +893,7 @@ TextSegment BreakFinder::Next() {
} else {
subBreak = -1;
}
return TextSegment(startSegment, lengthSegment);
return {startSegment, lengthSegment, nullptr};
}

bool BreakFinder::More() const noexcept {
Expand Down
4 changes: 1 addition & 3 deletions scintilla/src/PositionCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class LineLayoutCache final {
int styleClock;
void AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc);
public:
LineLayoutCache();
LineLayoutCache() noexcept;
// Deleted so LineLayoutCache objects can not be copied.
LineLayoutCache(const LineLayoutCache &) = delete;
LineLayoutCache(LineLayoutCache &&) = delete;
Expand Down Expand Up @@ -243,8 +243,6 @@ struct TextSegment {
const int start;
const int length;
const Representation * const representation;
TextSegment(int start_ = 0, int length_ = 0, const Representation *representation_ = nullptr) noexcept :
start(start_), length(length_), representation(representation_) {}
int end() const noexcept {
return start + length;
}
Expand Down

0 comments on commit 2f849a7

Please sign in to comment.