aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
authorZufu Liu <unknown>2022-12-21 08:48:45 +1100
committerZufu Liu <unknown>2022-12-21 08:48:45 +1100
commit61508c02e7e2ea4de857a2be604e1d80222083c1 (patch)
treed6cdd35a3f1c9df729430a36ea707600975de041 /src/Document.h
parentdb320f1668fceec9c625ac5ccdf9864200386f0e (diff)
downloadscintilla-mirror-61508c02e7e2ea4de857a2be604e1d80222083c1.tar.gz
Bug [#2340]. Avoid repeated call in GetFoldParent for around 10% performance
gain with Visual C++ 64-bit release mode on 300,000 line file. Remove duplicated code and simplify. GetFoldLevel and thus GetFoldParent can't throw so mark as noexcept.
Diffstat (limited to 'src/Document.h')
-rw-r--r--src/Document.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Document.h b/src/Document.h
index 3b0c8ab5a..8d5643e90 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -461,10 +461,10 @@ public:
int SCI_METHOD SetLevel(Sci_Position line, int level) override;
int SCI_METHOD GetLevel(Sci_Position line) const override;
- Scintilla::FoldLevel GetFoldLevel(Sci_Position line) const;
+ Scintilla::FoldLevel GetFoldLevel(Sci_Position line) const noexcept;
void ClearLevels();
Sci::Line GetLastChild(Sci::Line lineParent, std::optional<Scintilla::FoldLevel> level = {}, Sci::Line lastLine = -1);
- Sci::Line GetFoldParent(Sci::Line line) const;
+ Sci::Line GetFoldParent(Sci::Line line) const noexcept;
void GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine);
Sci::Position ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters=false) const;