summaryrefslogtreecommitdiff
path: root/src/string.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2022-12-15 13:29:45 +1100
committerMaxime Coste <mawww@kakoune.org>2022-12-15 13:29:45 +1100
commit20278ed52b175de20b57090f3087a23060a39e24 (patch)
tree11e6b67f3794d6c2845cc7b9044c9594ac4e68f9 /src/string.hh
parent8279a3776f38c875ef58da7823f56fb5ef3407bb (diff)
Support adding ByteCount to void/char pointers without casting
Diffstat (limited to 'src/string.hh')
-rw-r--r--src/string.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string.hh b/src/string.hh
index 4af99c80..9a7e39f0 100644
--- a/src/string.hh
+++ b/src/string.hh
@@ -36,10 +36,10 @@ public:
const_iterator begin() const { return type().data(); }
[[gnu::always_inline]]
- iterator end() { return type().data() + (int)type().length(); }
+ iterator end() { return type().data() + type().length(); }
[[gnu::always_inline]]
- const_iterator end() const { return type().data() + (int)type().length(); }
+ const_iterator end() const { return type().data() + type().length(); }
reverse_iterator rbegin() { return reverse_iterator{end()}; }
const_reverse_iterator rbegin() const { return const_reverse_iterator{end()}; }
@@ -77,10 +77,10 @@ public:
{ return utf8::advance(begin(), end(), count) - begin(); }
CharCount char_count_to(ByteCount count) const
- { return utf8::distance(begin(), begin() + (int)count); }
+ { return utf8::distance(begin(), begin() + count); }
ColumnCount column_count_to(ByteCount count) const
- { return utf8::column_distance(begin(), begin() + (int)count); }
+ { return utf8::column_distance(begin(), begin() + count); }
StringView substr(ByteCount from, ByteCount length = -1) const;
StringView substr(CharCount from, CharCount length = -1) const;