Make TextInputModel::selection_start/end const (flutter/engine#21685)

Neither of these methods mutate the state of the model.
This commit is contained in:
Chris Bracken
2020-10-07 22:04:02 -07:00
committed by GitHub
parent ad2f8cab17
commit c2fab63106

View File

@@ -117,12 +117,12 @@ class TextInputModel {
size_t selection_extent_ = 0;
// Returns the left hand side of the selection.
size_t selection_start() {
size_t selection_start() const {
return std::min(selection_base_, selection_extent_);
}
// Returns the right hand side of the selection.
size_t selection_end() {
size_t selection_end() const {
return std::max(selection_base_, selection_extent_);
}
};