diff options
| author | Jason Felice <jason.m.felice@gmail.com> | 2019-11-02 16:49:26 -0400 |
|---|---|---|
| committer | Jason Felice <jason.m.felice@gmail.com> | 2019-11-09 12:53:45 -0500 |
| commit | d26bb0ce2bd7bffd87b38b466f1e9642b85d0715 (patch) | |
| tree | 7d03051b0b2c104bf809c9d91fead12903cdc561 /src/selection.cc | |
| parent | 49ca5127336d1bac7b3e64e3efa7b20060a9f96a (diff) | |
Add static or const where useful
Diffstat (limited to 'src/selection.cc')
| -rw-r--r-- | src/selection.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/selection.cc b/src/selection.cc index e0dbbecb..33b4cd12 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -111,7 +111,7 @@ Iterator merge_overlapping(Iterator begin, Iterator end, size_t& main, OverlapsF BufferCoord& get_first(Selection& sel) { return sel.min(); } BufferCoord& get_last(Selection& sel) { return sel.max(); } -Vector<Selection> compute_modified_ranges(Buffer& buffer, size_t timestamp) +Vector<Selection> compute_modified_ranges(const Buffer& buffer, size_t timestamp) { Vector<Selection> ranges; auto changes = buffer.changes_since(timestamp); @@ -211,7 +211,7 @@ void clamp_selections(Vector<Selection>& selections, const Buffer& buffer) clamp(sel, buffer); } -void update_selections(Vector<Selection>& selections, size_t& main, Buffer& buffer, size_t timestamp, bool merge) +void update_selections(Vector<Selection>& selections, size_t& main, const Buffer& buffer, size_t timestamp, bool merge) { if (timestamp == buffer.timestamp()) return; @@ -474,8 +474,8 @@ void SelectionList::erase() String selection_to_string(const Selection& selection) { - auto& cursor = selection.cursor(); - auto& anchor = selection.anchor(); + const auto& cursor = selection.cursor(); + const auto& anchor = selection.anchor(); return format("{}.{},{}.{}", anchor.line + 1, anchor.column + 1, cursor.line + 1, cursor.column + 1); } |
