aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-08-22 22:14:34 +1000
committerNeil <nyamatongwe@gmail.com>2021-08-22 22:14:34 +1000
commitafbd611bed7f27d0790fc19b18318e3ef213dfd8 (patch)
tree25f2007712e60e5062de4b007bf78c90f239d88c
parent6f709917a1134aaf55fc83d8a9f18a30b50efd89 (diff)
downloadscintilla-mirror-afbd611bed7f27d0790fc19b18318e3ef213dfd8.tar.gz
Follow rule-of-zero / rule-of-5 where reasonable by removing standard operators
that are not needed.
-rw-r--r--src/CaseConvert.cxx1
-rw-r--r--src/CaseFolder.cxx3
-rw-r--r--src/CaseFolder.h1
-rw-r--r--src/Decoration.cxx4
-rw-r--r--src/Document.cxx5
-rw-r--r--src/Document.h2
-rw-r--r--src/KeyMap.cxx4
-rw-r--r--src/KeyMap.h1
-rw-r--r--src/RESearch.cxx4
-rw-r--r--src/RESearch.h1
10 files changed, 2 insertions, 24 deletions
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx
index fd1bee2c9..59062d57d 100644
--- a/src/CaseConvert.cxx
+++ b/src/CaseConvert.cxx
@@ -609,7 +609,6 @@ class CaseConverter : public ICaseConverter {
public:
CaseConverter() noexcept {
}
- virtual ~CaseConverter() = default;
bool Initialised() const noexcept {
return !characters.empty();
}
diff --git a/src/CaseFolder.cxx b/src/CaseFolder.cxx
index 47f319504..b5acc5f96 100644
--- a/src/CaseFolder.cxx
+++ b/src/CaseFolder.cxx
@@ -23,9 +23,6 @@ CaseFolderTable::CaseFolderTable() noexcept : mapping{} {
}
}
-CaseFolderTable::~CaseFolderTable() {
-}
-
size_t CaseFolderTable::Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) {
if (lenMixed > sizeFolded) {
return 0;
diff --git a/src/CaseFolder.h b/src/CaseFolder.h
index 1169f9bd7..45abe4d8f 100644
--- a/src/CaseFolder.h
+++ b/src/CaseFolder.h
@@ -21,7 +21,6 @@ protected:
char mapping[256];
public:
CaseFolderTable() noexcept;
- ~CaseFolderTable() override;
size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override;
void SetTranslation(char ch, char chTranslation) noexcept;
void StandardASCII() noexcept;
diff --git a/src/Decoration.cxx b/src/Decoration.cxx
index 4fd6b3b58..163347ce9 100644
--- a/src/Decoration.cxx
+++ b/src/Decoration.cxx
@@ -39,8 +39,6 @@ public:
explicit Decoration(int indicator_) : indicator(indicator_) {
}
- ~Decoration() override {
- }
bool Empty() const noexcept override {
return (rs.Runs() == 1) && (rs.AllSameAs(0));
@@ -75,7 +73,7 @@ template <typename POS>
class DecorationList : public IDecorationList {
int currentIndicator;
int currentValue;
- Decoration<POS> *current; // Cached so FillRange doesn't have to search for each call.
+ Decoration<POS> *current; // Non-owning. Cached so FillRange doesn't have to search for each call.
Sci::Position lengthDocument;
// Ordered by indicator
std::vector<std::unique_ptr<Decoration<POS>>> decorationList;
diff --git a/src/Document.cxx b/src/Document.cxx
index 24ddd04ce..01949dc5e 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2812,11 +2812,6 @@ Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxRe
class BuiltinRegex : public RegexSearchBase {
public:
explicit BuiltinRegex(CharClassify *charClassTable) : search(charClassTable) {}
- BuiltinRegex(const BuiltinRegex &) = delete;
- BuiltinRegex(BuiltinRegex &&) = delete;
- BuiltinRegex &operator=(const BuiltinRegex &) = delete;
- BuiltinRegex &operator=(BuiltinRegex &&) = delete;
- ~BuiltinRegex() override = default;
Sci::Position FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s,
bool caseSensitive, bool word, bool wordStart, FindOption flags,
diff --git a/src/Document.h b/src/Document.h
index e2962b4a3..402f37c17 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -90,7 +90,7 @@ public:
*/
class RegexSearchBase {
public:
- virtual ~RegexSearchBase() {}
+ virtual ~RegexSearchBase() = default;
virtual Sci::Position FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s,
bool caseSensitive, bool word, bool wordStart, Scintilla::FindOption flags, Sci::Position *length) = 0;
diff --git a/src/KeyMap.cxx b/src/KeyMap.cxx
index ae189db55..38a8911c9 100644
--- a/src/KeyMap.cxx
+++ b/src/KeyMap.cxx
@@ -32,10 +32,6 @@ KeyMap::KeyMap() {
}
}
-KeyMap::~KeyMap() {
- Clear();
-}
-
void KeyMap::Clear() noexcept {
kmap.clear();
}
diff --git a/src/KeyMap.h b/src/KeyMap.h
index 6662118b2..bcdee9c81 100644
--- a/src/KeyMap.h
+++ b/src/KeyMap.h
@@ -52,7 +52,6 @@ class KeyMap {
public:
KeyMap();
- ~KeyMap();
void Clear() noexcept;
void AssignCmdKey(Scintilla::Keys key, Scintilla::KeyMod modifiers, Scintilla::Message msg);
Scintilla::Message Find(Scintilla::Keys key, Scintilla::KeyMod modifiers) const; // 0 returned on failure
diff --git a/src/RESearch.cxx b/src/RESearch.cxx
index 6d30e4c6b..15f3d6281 100644
--- a/src/RESearch.cxx
+++ b/src/RESearch.cxx
@@ -260,10 +260,6 @@ RESearch::RESearch(CharClassify *charClassTable) {
Clear();
}
-RESearch::~RESearch() {
- Clear();
-}
-
void RESearch::Clear() noexcept {
for (int i = 0; i < MAXTAG; i++) {
pat[i].clear();
diff --git a/src/RESearch.h b/src/RESearch.h
index 4f0598826..306d1b3d1 100644
--- a/src/RESearch.h
+++ b/src/RESearch.h
@@ -23,7 +23,6 @@ class RESearch {
public:
explicit RESearch(CharClassify *charClassTable);
// No dynamic allocation so default copy constructor and assignment operator are OK.
- ~RESearch();
void Clear() noexcept;
void GrabMatches(const CharacterIndexer &ci);
const char *Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix) noexcept;