aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx12
-rw-r--r--src/PerLine.cxx4
-rw-r--r--src/PositionCache.cxx10
3 files changed, 8 insertions, 18 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 430469d5f..63deb701a 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -9069,9 +9069,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_CREATEDOCUMENT: {
Document *doc = new Document();
- if (doc) {
- doc->AddRef();
- }
+ doc->AddRef();
return reinterpret_cast<sptr_t>(doc);
}
@@ -9085,11 +9083,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_CREATELOADER: {
Document *doc = new Document();
- if (doc) {
- doc->AddRef();
- doc->Allocate(wParam);
- doc->SetUndoCollection(false);
- }
+ doc->AddRef();
+ doc->Allocate(wParam);
+ doc->SetUndoCollection(false);
return reinterpret_cast<sptr_t>(static_cast<ILoader *>(doc));
}
diff --git a/src/PerLine.cxx b/src/PerLine.cxx
index cc46fb9a2..7e25e4823 100644
--- a/src/PerLine.cxx
+++ b/src/PerLine.cxx
@@ -68,8 +68,6 @@ bool MarkerHandleSet::Contains(int handle) const {
bool MarkerHandleSet::InsertHandle(int handle, int markerNum) {
MarkerHandleNumber *mhn = new MarkerHandleNumber;
- if (!mhn)
- return false;
mhn->handle = handle;
mhn->number = markerNum;
mhn->next = root;
@@ -200,8 +198,6 @@ int LineMarkers::AddMark(int line, int markerNum, int lines) {
if (!markers[line]) {
// Need new structure to hold marker handle
markers[line] = new MarkerHandleSet();
- if (!markers[line])
- return -1;
}
markers[line]->InsertHandle(handleCurrent, markerNum);
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 9fb045636..b03a97d38 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -309,12 +309,10 @@ LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChar
if (!cache[pos]) {
cache[pos] = new LineLayout(maxChars);
}
- if (cache[pos]) {
- cache[pos]->lineNumber = lineNumber;
- cache[pos]->inCache = true;
- ret = cache[pos];
- useCount++;
- }
+ cache[pos]->lineNumber = lineNumber;
+ cache[pos]->inCache = true;
+ ret = cache[pos];
+ useCount++;
}
}