Skip to content

Commit

Permalink
Constify read-only argument for FindLink and FindExact (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo authored Dec 22, 2023
1 parent d300b78 commit c390be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ struct Cell {
return best;
}

Cell *FindLink(Selection &s, Cell *link, Cell *best, bool &lastthis, bool &stylematch,
Cell *FindLink(const Selection &s, Cell *link, Cell *best, bool &lastthis, bool &stylematch,
bool forward, bool image) {
if (grid) best = grid->FindLink(s, link, best, lastthis, stylematch, forward, image);
if (link == this) {
Expand Down Expand Up @@ -466,7 +466,7 @@ struct Cell {
text.ReplaceStr(str, lstr);
}

Cell *FindExact(wxString &s) {
Cell *FindExact(const wxString &s) {
return text.t == s ? this : (grid ? grid->FindExact(s) : nullptr);
}

Expand Down
4 changes: 2 additions & 2 deletions src/grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ struct Grid {
}
}

Cell *FindLink(Selection &s, Cell *link, Cell *best, bool &lastthis, bool &stylematch,
Cell *FindLink(const Selection &s, Cell *link, Cell *best, bool &lastthis, bool &stylematch,
bool forward, bool image) {
if (forward) {
foreachcell(c) best = c->FindLink(s, link, best, lastthis, stylematch, forward, image);
Expand Down Expand Up @@ -903,7 +903,7 @@ struct Grid {
(int(__cdecl *)(const void *, const void *))sortfunc);
}

Cell *FindExact(wxString &s) {
Cell *FindExact(const wxString &s) {
foreachcell(c) {
Cell *f = c->FindExact(s);
if (f) return f;
Expand Down

0 comments on commit c390be9

Please sign in to comment.