diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-01 12:35:09 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-01 12:58:22 +0100 |
commit | 22d0a6d92f9e5a93b248eef0609d40ecb332f869 (patch) | |
tree | 6ec543d38dbeda281c6719ae5cc33ef3eb47c496 /Libraries/LibGUI/TextDocument.h | |
parent | fee20bd8de0f9c4222f7123f5c6ea31f00221d7b (diff) | |
download | serenity-22d0a6d92f9e5a93b248eef0609d40ecb332f869.zip |
AK: Remove unnecessary casts to size_t, after Vector changes
Now that Vector uses size_t, we can remove a whole bunch of redundant
casts to size_t.
Diffstat (limited to 'Libraries/LibGUI/TextDocument.h')
-rw-r--r-- | Libraries/LibGUI/TextDocument.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibGUI/TextDocument.h b/Libraries/LibGUI/TextDocument.h index 51234450b7..76ce03d23a 100644 --- a/Libraries/LibGUI/TextDocument.h +++ b/Libraries/LibGUI/TextDocument.h @@ -75,9 +75,9 @@ public: static NonnullRefPtr<TextDocument> create(Client* client = nullptr); ~TextDocument(); - size_t line_count() const { return (size_t)m_lines.size(); } - const TextDocumentLine& line(size_t line_index) const { return m_lines[(int)line_index]; } - TextDocumentLine& line(size_t line_index) { return m_lines[(int)line_index]; } + size_t line_count() const { return m_lines.size(); } + const TextDocumentLine& line(size_t line_index) const { return m_lines[line_index]; } + TextDocumentLine& line(size_t line_index) { return m_lines[line_index]; } void set_spans(const Vector<TextDocumentSpan>& spans) { m_spans = spans; } @@ -88,7 +88,7 @@ public: bool has_spans() const { return !m_spans.is_empty(); } const Vector<TextDocumentSpan>& spans() const { return m_spans; } - void set_span_at_index(size_t index, TextDocumentSpan span) { m_spans[(int)index] = move(span); } + void set_span_at_index(size_t index, TextDocumentSpan span) { m_spans[index] = move(span); } void append_line(NonnullOwnPtr<TextDocumentLine>); void remove_line(size_t line_index); @@ -156,7 +156,7 @@ public: StringView view() const { return { characters(), (size_t)length() }; } const char* characters() const { return m_text.data(); } - size_t length() const { return (size_t)m_text.size() - 1; } + size_t length() const { return m_text.size() - 1; } void set_text(TextDocument&, const StringView&); void append(TextDocument&, char); void prepend(TextDocument&, char); |